diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index 326b644e3280..632905a1a5da 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -833,6 +833,13 @@ pom import + + com.google.cloud + google-cloud-redis-cluster-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-redis-bom diff --git a/java-redis-cluster/.OwlBot.yaml b/java-redis-cluster/.OwlBot.yaml new file mode 100644 index 000000000000..5c7b69d775ca --- /dev/null +++ b/java-redis-cluster/.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-redis-cluster/grpc-google-.*/src" +- "/java-redis-cluster/proto-google-.*/src" +- "/java-redis-cluster/google-.*/src" +- "/java-redis-cluster/samples/snippets/generated" + +deep-preserve-regex: +- "/java-redis-cluster/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/redis/cluster/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-redis-cluster/$1/proto-google-cloud-redis-cluster-$1/src" +- source: "/google/cloud/redis/cluster/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-redis-cluster/$1/grpc-google-cloud-redis-cluster-$1/src" +- source: "/google/cloud/redis/cluster/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-redis-cluster/$1/google-cloud-redis-cluster/src" +- source: "/google/cloud/redis/cluster/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-redis-cluster/$1/samples/snippets/generated" + + +api-name: redis-cluster \ No newline at end of file diff --git a/java-redis-cluster/.repo-metadata.json b/java-redis-cluster/.repo-metadata.json new file mode 100644 index 000000000000..5a181b992bd6 --- /dev/null +++ b/java-redis-cluster/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "api_shortname": "redis-cluster", + "name_pretty": "Google Cloud Memorystore for Redis API", + "product_documentation": "https://cloud.google.com/memorystore/docs/cluster", + "api_description": "Creates and manages Redis instances on the Google Cloud Platform.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-redis-cluster/latest/overview", + "release_level": "preview", + "transport": "grpc", + "language": "java", + "repo": "googleapis/java-redis-cluster", + "repo_short": "java-redis-cluster", + "distribution_name": "com.google.cloud:google-cloud-redis-cluster", + "api_id": "redis-cluster.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true +} \ No newline at end of file diff --git a/java-redis-cluster/README.md b/java-redis-cluster/README.md new file mode 100644 index 000000000000..8328850aad00 --- /dev/null +++ b/java-redis-cluster/README.md @@ -0,0 +1,225 @@ +# Google Google Cloud Memorystore for Redis API Client for Java + +Java idiomatic client for [Google Cloud Memorystore for Redis API][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 with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.25.0 + pom + import + + + + + + + com.google.cloud + google-cloud-redis-cluster + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + + +```xml + + com.google.cloud + google-cloud-redis-cluster + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-redis-cluster:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-redis-cluster" % "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 Google Cloud Memorystore for Redis API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Google Cloud Memorystore for Redis API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Google Cloud Memorystore for Redis API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Google Cloud Memorystore for Redis API. +[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 Command Line Interface][cloud-cli] 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-redis-cluster` library. See the [Quickstart](#quickstart) section +to add `google-cloud-redis-cluster` as a dependency in your code. + +## About Google Cloud Memorystore for Redis API + + +[Google Cloud Memorystore for Redis API][product-docs] Creates and manages Redis instances on the Google Cloud Platform. + +See the [Google Cloud Memorystore for Redis API client library docs][javadocs] to learn how to +use this Google Cloud Memorystore for Redis API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Google Cloud Memorystore for Redis API 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/memorystore/docs/cluster +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-redis-cluster/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/java-redis-cluster/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-redis-cluster.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-redis-cluster/0.0.0 +[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-cli]: https://cloud.google.com/cli +[troubleshooting]: https://github.com/googleapis/google-cloud-java/blob/main/TROUBLESHOOTING.md +[contributing]: https://github.com/googleapis/java-redis-cluster/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/java-redis-cluster/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/java-redis-cluster/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=redis-cluster.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-redis-cluster/google-cloud-redis-cluster-bom/pom.xml b/java-redis-cluster/google-cloud-redis-cluster-bom/pom.xml new file mode 100644 index 000000000000..3c72d28c7d5e --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster-bom/pom.xml @@ -0,0 +1,54 @@ + + + 4.0.0 + com.google.cloud + google-cloud-redis-cluster-bom + 0.0.1-SNAPSHOT + pom + + + com.google.cloud + google-cloud-pom-parent + 1.23.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Google Cloud Memorystore for Redis API BOM + + BOM for Google Cloud Memorystore for Redis API + + + + true + + + + + + com.google.cloud + google-cloud-redis-cluster + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-redis-cluster-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-redis-cluster-v1 + 0.0.1-SNAPSHOT + + + + diff --git a/java-redis-cluster/google-cloud-redis-cluster/pom.xml b/java-redis-cluster/google-cloud-redis-cluster/pom.xml new file mode 100644 index 000000000000..e526d4307391 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/pom.xml @@ -0,0 +1,122 @@ + + + 4.0.0 + com.google.cloud + google-cloud-redis-cluster + 0.0.1-SNAPSHOT + jar + Google Google Cloud Memorystore for Redis API + Google Cloud Memorystore for Redis API Creates and manages Redis instances on the Google Cloud Platform. + + com.google.cloud + google-cloud-redis-cluster-parent + 0.0.1-SNAPSHOT + + + google-cloud-redis-cluster + + + + 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-redis-cluster-v1beta1 + + + com.google.api.grpc + proto-google-cloud-redis-cluster-v1 + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + grpc-google-common-protos + + + com.google.api.grpc + proto-google-iam-v1 + + + com.google.api.grpc + grpc-google-iam-v1 + + + org.threeten + threetenbp + + + + + junit + junit + test + + + + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1 + test + + + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1beta1 + 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClient.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClient.java new file mode 100644 index 000000000000..f0115cbf62cd --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClient.java @@ -0,0 +1,1410 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.stub.CloudRedisClusterStub; +import com.google.cloud.redis.cluster.v1.stub.CloudRedisClusterStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +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: Configures and manages Cloud Memorystore for Redis clusters + * + *

Google Cloud Memorystore for Redis Cluster + * + *

The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and + * defines the following resource model for managing Redis clusters: + * + *

+ * + *

Note that location_id must be a GCP `region`; for example: + * + *

+ * + *

We use API version selector for Flex APIs + * + *

+ * + *

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

Note: close() needs to be called on the CloudRedisClusterClient 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 CloudRedisClusterSettings 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
+ * CloudRedisClusterSettings cloudRedisClusterSettings =
+ *     CloudRedisClusterSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudRedisClusterClient cloudRedisClusterClient =
+ *     CloudRedisClusterClient.create(cloudRedisClusterSettings);
+ * }
+ * + *

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
+ * CloudRedisClusterSettings cloudRedisClusterSettings =
+ *     CloudRedisClusterSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudRedisClusterClient cloudRedisClusterClient =
+ *     CloudRedisClusterClient.create(cloudRedisClusterSettings);
+ * }
+ * + *

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
+ * CloudRedisClusterSettings cloudRedisClusterSettings =
+ *     CloudRedisClusterSettings.newHttpJsonBuilder().build();
+ * CloudRedisClusterClient cloudRedisClusterClient =
+ *     CloudRedisClusterClient.create(cloudRedisClusterSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class CloudRedisClusterClient implements BackgroundResource { + private final CloudRedisClusterSettings settings; + private final CloudRedisClusterStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of CloudRedisClusterClient with default settings. */ + public static final CloudRedisClusterClient create() throws IOException { + return create(CloudRedisClusterSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudRedisClusterClient, 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 CloudRedisClusterClient create(CloudRedisClusterSettings settings) + throws IOException { + return new CloudRedisClusterClient(settings); + } + + /** + * Constructs an instance of CloudRedisClusterClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CloudRedisClusterSettings). + */ + public static final CloudRedisClusterClient create(CloudRedisClusterStub stub) { + return new CloudRedisClusterClient(stub); + } + + /** + * Constructs an instance of CloudRedisClusterClient, 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 CloudRedisClusterClient(CloudRedisClusterSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudRedisClusterStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected CloudRedisClusterClient(CloudRedisClusterStub 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 CloudRedisClusterSettings getSettings() { + return settings; + } + + public CloudRedisClusterStub 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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Cluster element : cloudRedisClusterClient.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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

    + *
  • `projects/{project_id}/locations/{location_id}` + *
+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListClustersResponse response =
+   *         cloudRedisClusterClient.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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = cloudRedisClusterClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = cloudRedisClusterClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   Cluster response = cloudRedisClusterClient.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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   ApiFuture future = cloudRedisClusterClient.getClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getClusterCallable() { + return stub.getClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Cluster response = cloudRedisClusterClient.updateClusterAsync(cluster, updateMask).get();
+   * }
+   * }
+ * + * @param cluster Required. Update description. Only fields specified in update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these fields from + * [Cluster][google.cloud.redis.cluster.v1.Cluster]: + *

* `size_gb` * `replica_count` + * @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 metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Cluster response = cloudRedisClusterClient.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 metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudRedisClusterClient.updateClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateClusterOperationCallable() { + return stub.updateClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.updateClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateClusterCallable() { + return stub.updateClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   cloudRedisClusterClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   cloudRedisClusterClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   cloudRedisClusterClient.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 specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudRedisClusterClient.deleteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteClusterOperationCallable() { + return stub.deleteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.deleteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteClusterCallable() { + return stub.deleteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @param cluster Required. The cluster that is to be created. + * @param clusterId Required. The logical name of the Redis cluster in the customer project with + * the following restrictions: + *
    + *
  • Must contain only lowercase letters, numbers, and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-63 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project / location + *
+ * + * @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 Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @param cluster Required. The cluster that is to be created. + * @param clusterId Required. The logical name of the Redis cluster in the customer project with + * the following restrictions: + *
    + *
  • Must contain only lowercase letters, numbers, and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-63 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project / location + *
+ * + * @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 Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Cluster response = cloudRedisClusterClient.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 Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudRedisClusterClient.createClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createClusterOperationCallable() { + return stub.createClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.createClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createClusterCallable() { + return stub.createClusterCallable(); + } + + // 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.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 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterSettings.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterSettings.java new file mode 100644 index 000000000000..f59ba3032c24 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterSettings.java @@ -0,0 +1,318 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1; + +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.stub.CloudRedisClusterStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +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 CloudRedisClusterClient}. + * + *

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

    + *
  • The default service address (redis.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
+ * CloudRedisClusterSettings.Builder cloudRedisClusterSettingsBuilder =
+ *     CloudRedisClusterSettings.newBuilder();
+ * cloudRedisClusterSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         cloudRedisClusterSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudRedisClusterSettings cloudRedisClusterSettings = cloudRedisClusterSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudRedisClusterSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).listClustersSettings(); + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).updateClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).updateClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).deleteClusterSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings deleteClusterOperationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).deleteClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).createClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).createClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final CloudRedisClusterSettings create(CloudRedisClusterStubSettings stub) + throws IOException { + return new CloudRedisClusterSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudRedisClusterStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudRedisClusterStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudRedisClusterStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudRedisClusterStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudRedisClusterStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudRedisClusterStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudRedisClusterStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudRedisClusterStubSettings.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 CloudRedisClusterSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudRedisClusterSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudRedisClusterStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudRedisClusterSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudRedisClusterStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudRedisClusterStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(CloudRedisClusterStubSettings.newHttpJsonBuilder()); + } + + public CloudRedisClusterStubSettings.Builder getStubSettingsBuilder() { + return ((CloudRedisClusterStubSettings.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 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 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 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 CloudRedisClusterSettings build() throws IOException { + return new CloudRedisClusterSettings(this); + } + } +} diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/gapic_metadata.json b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/gapic_metadata.json new file mode 100644 index 000000000000..58d43a0ef8e8 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/gapic_metadata.json @@ -0,0 +1,39 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.redis.cluster.v1", + "libraryPackage": "com.google.cloud.redis.cluster.v1", + "services": { + "CloudRedisCluster": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClusterClient", + "rpcs": { + "CreateCluster": { + "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"] + }, + "DeleteCluster": { + "methods": ["deleteClusterAsync", "deleteClusterAsync", "deleteClusterAsync", "deleteClusterOperationCallable", "deleteClusterCallable"] + }, + "GetCluster": { + "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListClusters": { + "methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "UpdateCluster": { + "methods": ["updateClusterAsync", "updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/package-info.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/package-info.java new file mode 100644 index 000000000000..c4ce8ed398e8 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/package-info.java @@ -0,0 +1,71 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Google Cloud Memorystore for Redis API + * + *

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

======================= CloudRedisClusterClient ======================= + * + *

Service Description: Configures and manages Cloud Memorystore for Redis clusters + * + *

Google Cloud Memorystore for Redis Cluster + * + *

The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and + * defines the following resource model for managing Redis clusters: + * + *

    + *
  • The service works with a collection of cloud projects, named: `/projects/*` + *
  • Each project has a collection of available locations, named: `/locations/*` + *
  • Each location has a collection of Redis clusters, named: `/clusters/*` + *
  • As such, Redis clusters are resources of the form: + * `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + *
+ * + *

Note that location_id must be a GCP `region`; for example: + * + *

    + *
  • `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + *
+ * + *

We use API version selector for Flex APIs + * + *

    + *
  • The versioning strategy is release-based versioning + *
  • Our backend CLH only deals with the superset version (called v1main) + *
  • Existing backend for Redis Gen1 and MRR is not touched. + *
  • More details in go/redis-flex-api-versioning + *
+ * + *

Sample for CloudRedisClusterClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = cloudRedisClusterClient.getCluster(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.redis.cluster.v1; + +import javax.annotation.Generated; diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStub.java new file mode 100644 index 000000000000..1c4e842cb645 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStub.java @@ -0,0 +1,110 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.stub; + +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudRedisCluster service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class CloudRedisClusterStub 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 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 createClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterOperationCallable()"); + } + + public UnaryCallable createClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterCallable()"); + } + + 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStubSettings.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStubSettings.java new file mode 100644 index 000000000000..1ba7d6c98ef1 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/CloudRedisClusterStubSettings.java @@ -0,0 +1,736 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.stub; + +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1.UpdateClusterRequest; +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.Any; +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 CloudRedisClusterStub}. + * + *

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

    + *
  • The default service address (redis.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
+ * CloudRedisClusterStubSettings.Builder cloudRedisClusterSettingsBuilder =
+ *     CloudRedisClusterStubSettings.newBuilder();
+ * cloudRedisClusterSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         cloudRedisClusterSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudRedisClusterStubSettings cloudRedisClusterSettings =
+ *     cloudRedisClusterSettingsBuilder.build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class CloudRedisClusterStubSettings 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 updateClusterSettings; + private final OperationCallSettings + updateClusterOperationSettings; + private final UnaryCallSettings deleteClusterSettings; + private final OperationCallSettings + deleteClusterOperationSettings; + private final UnaryCallSettings createClusterSettings; + private final OperationCallSettings + createClusterOperationSettings; + 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_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< + 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 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 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 listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public CloudRedisClusterStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudRedisClusterStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudRedisClusterStub.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 "redis.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "redis.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(CloudRedisClusterStubSettings.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(CloudRedisClusterStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudRedisClusterStubSettings.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 CloudRedisClusterStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listClustersSettings = settingsBuilder.listClustersSettings().build(); + getClusterSettings = settingsBuilder.getClusterSettings().build(); + updateClusterSettings = settingsBuilder.updateClusterSettings().build(); + updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); + deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); + deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build(); + createClusterSettings = settingsBuilder.createClusterSettings().build(); + createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for CloudRedisClusterStubSettings. */ + 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 updateClusterSettings; + private final OperationCallSettings.Builder + updateClusterOperationSettings; + private final UnaryCallSettings.Builder deleteClusterSettings; + private final OperationCallSettings.Builder + deleteClusterOperationSettings; + private final UnaryCallSettings.Builder createClusterSettings; + private final OperationCallSettings.Builder + createClusterOperationSettings; + 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( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_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(); + updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClusterOperationSettings = OperationCallSettings.newBuilder(); + deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteClusterOperationSettings = OperationCallSettings.newBuilder(); + createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + updateClusterSettings, + deleteClusterSettings, + createClusterSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(CloudRedisClusterStubSettings settings) { + super(settings); + + listClustersSettings = settings.listClustersSettings.toBuilder(); + getClusterSettings = settings.getClusterSettings.toBuilder(); + updateClusterSettings = settings.updateClusterSettings.toBuilder(); + updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); + deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); + deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder(); + createClusterSettings = settings.createClusterSettings.toBuilder(); + createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + updateClusterSettings, + deleteClusterSettings, + createClusterSettings, + 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("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(7200000L)) + .build())); + + builder + .deleteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(1200000L)) + .build())); + + builder + .createClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(7200000L)) + .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 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 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 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 CloudRedisClusterStubSettings build() throws IOException { + return new CloudRedisClusterStubSettings(this); + } + } +} diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterCallableFactory.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterCallableFactory.java new file mode 100644 index 000000000000..5e2a6deb808e --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterCallableFactory.java @@ -0,0 +1,113 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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 CloudRedisCluster service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudRedisClusterCallableFactory 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterStub.java new file mode 100644 index 000000000000..d42210cfc4b4 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/GrpcCloudRedisClusterStub.java @@ -0,0 +1,408 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.stub; + +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +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.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Any; +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 CloudRedisCluster service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class GrpcCloudRedisClusterStub extends CloudRedisClusterStub { + private static final MethodDescriptor + listClustersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/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.redis.cluster.v1.CloudRedisCluster/GetCluster") + .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/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.redis.cluster.v1.CloudRedisCluster/DeleteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/CreateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.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 updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable deleteClusterOperationCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + 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 GrpcCloudRedisClusterStub create(CloudRedisClusterStubSettings settings) + throws IOException { + return new GrpcCloudRedisClusterStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudRedisClusterStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudRedisClusterStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudRedisClusterStub, 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 GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCloudRedisClusterCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudRedisClusterStub, 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 GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listClustersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("cluster.name", String.valueOf(request.getCluster().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.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.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.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + operationsStub); + 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 updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterCallableFactory.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterCallableFactory.java new file mode 100644 index 000000000000..7473249f19ff --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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 CloudRedisCluster service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCloudRedisClusterCallableFactory + 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterStub.java new file mode 100644 index 000000000000..93f95d46fc36 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1/stub/HttpJsonCloudRedisClusterStub.java @@ -0,0 +1,668 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.stub; + +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse; + +import com.google.api.HttpRule; +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +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.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1.UpdateClusterRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +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 CloudRedisCluster service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +@BetaApi +public class HttpJsonCloudRedisClusterStub extends CloudRedisClusterStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Cluster.getDescriptor()) + .add(Any.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listClustersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/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, "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.redis.cluster.v1.CloudRedisCluster/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 + updateClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + 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.redis.cluster.v1.CloudRedisCluster/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, "requestId", request.getRequestId()); + 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 + createClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.redis.cluster.v1.CloudRedisCluster/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, "$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 + 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 updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable deleteClusterOperationCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + 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 HttpJsonCloudRedisClusterStub create(CloudRedisClusterStubSettings settings) + throws IOException { + return new HttpJsonCloudRedisClusterStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudRedisClusterStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudRedisClusterStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudRedisClusterStub, 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 HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonCloudRedisClusterCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudRedisClusterStub, 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 HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings listClustersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("cluster.name", String.valueOf(request.getCluster().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.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.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.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + 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(updateClusterMethodDescriptor); + methodDescriptors.add(deleteClusterMethodDescriptor); + methodDescriptors.add(createClusterMethodDescriptor); + 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 updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClient.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClient.java new file mode 100644 index 000000000000..d35582686025 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClient.java @@ -0,0 +1,1411 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.stub.CloudRedisClusterStub; +import com.google.cloud.redis.cluster.v1beta1.stub.CloudRedisClusterStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +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: Configures and manages Cloud Memorystore for Redis clusters + * + *

Google Cloud Memorystore for Redis Cluster + * + *

The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and + * defines the following resource model for managing Redis clusters: + * + *

    + *
  • The service works with a collection of cloud projects, named: `/projects/*` + *
  • Each project has a collection of available locations, named: `/locations/*` + *
  • Each location has a collection of Redis clusters, named: `/clusters/*` + *
  • As such, Redis clusters are resources of the form: + * `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + *
+ * + *

Note that location_id must be a GCP `region`; for example: + * + *

    + *
  • `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + *
+ * + *

We use API version selector for Flex APIs + * + *

    + *
  • The versioning strategy is release-based versioning + *
  • Our backend CLH only deals with the superset version (called v1main) + *
  • Existing backend for Redis Gen1 and MRR is not touched. + *
  • More details in go/redis-flex-api-versioning + *
+ * + *

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

Note: close() needs to be called on the CloudRedisClusterClient 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 CloudRedisClusterSettings 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
+ * CloudRedisClusterSettings cloudRedisClusterSettings =
+ *     CloudRedisClusterSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * CloudRedisClusterClient cloudRedisClusterClient =
+ *     CloudRedisClusterClient.create(cloudRedisClusterSettings);
+ * }
+ * + *

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
+ * CloudRedisClusterSettings cloudRedisClusterSettings =
+ *     CloudRedisClusterSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * CloudRedisClusterClient cloudRedisClusterClient =
+ *     CloudRedisClusterClient.create(cloudRedisClusterSettings);
+ * }
+ * + *

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
+ * CloudRedisClusterSettings cloudRedisClusterSettings =
+ *     CloudRedisClusterSettings.newHttpJsonBuilder().build();
+ * CloudRedisClusterClient cloudRedisClusterClient =
+ *     CloudRedisClusterClient.create(cloudRedisClusterSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudRedisClusterClient implements BackgroundResource { + private final CloudRedisClusterSettings settings; + private final CloudRedisClusterStub stub; + private final OperationsClient httpJsonOperationsClient; + private final com.google.longrunning.OperationsClient operationsClient; + + /** Constructs an instance of CloudRedisClusterClient with default settings. */ + public static final CloudRedisClusterClient create() throws IOException { + return create(CloudRedisClusterSettings.newBuilder().build()); + } + + /** + * Constructs an instance of CloudRedisClusterClient, 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 CloudRedisClusterClient create(CloudRedisClusterSettings settings) + throws IOException { + return new CloudRedisClusterClient(settings); + } + + /** + * Constructs an instance of CloudRedisClusterClient, using the given stub for making calls. This + * is for advanced usage - prefer using create(CloudRedisClusterSettings). + */ + public static final CloudRedisClusterClient create(CloudRedisClusterStub stub) { + return new CloudRedisClusterClient(stub); + } + + /** + * Constructs an instance of CloudRedisClusterClient, 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 CloudRedisClusterClient(CloudRedisClusterSettings settings) throws IOException { + this.settings = settings; + this.stub = ((CloudRedisClusterStubSettings) settings.getStubSettings()).createStub(); + this.operationsClient = + com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub()); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected CloudRedisClusterClient(CloudRedisClusterStub 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 CloudRedisClusterSettings getSettings() { + return settings; + } + + public CloudRedisClusterStub 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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

    + *
  • `projects/{project_id}/locations/{location_id}` + *
+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

    + *
  • `projects/{project_id}/locations/{location_id}` + *
+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

    + *
  • `projects/{project_id}/locations/{location_id}` + *
+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Cluster element : cloudRedisClusterClient.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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

    + *
  • `projects/{project_id}/locations/{location_id}` + *
+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.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 all Redis clusters owned by a project in either the specified location (region) or all + * locations. + * + *

The location should have the following format: + * + *

    + *
  • `projects/{project_id}/locations/{location_id}` + *
+ * + *

If `location_id` is specified as `-` (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListClustersRequest request =
+   *       ListClustersRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListClustersResponse response =
+   *         cloudRedisClusterClient.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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   Cluster response = cloudRedisClusterClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   Cluster response = cloudRedisClusterClient.getCluster(name);
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   Cluster response = cloudRedisClusterClient.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 the details of a specific Redis 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetClusterRequest request =
+   *       GetClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .build();
+   *   ApiFuture future = cloudRedisClusterClient.getClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getClusterCallable() { + return stub.getClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Cluster response = cloudRedisClusterClient.updateClusterAsync(cluster, updateMask).get();
+   * }
+   * }
+ * + * @param cluster Required. Update description. Only fields specified in update_mask are updated. + * @param updateMask Required. Mask of fields to update. At least one path must be supplied in + * this field. The elements of the repeated paths field may only include these fields from + * [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]: + *

* `size_gb` * `replica_count` + * @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 metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Cluster response = cloudRedisClusterClient.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 metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudRedisClusterClient.updateClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + updateClusterOperationCallable() { + return stub.updateClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the metadata and configuration of a specific Redis cluster. + * + *

Completed longrunning.Operation will contain the new cluster object in the response field. + * The returned operation is automatically deleted after a few hours, so there is no need to call + * DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   UpdateClusterRequest request =
+   *       UpdateClusterRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.updateClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable updateClusterCallable() { + return stub.updateClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+   *   cloudRedisClusterClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString();
+   *   cloudRedisClusterClient.deleteClusterAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. Redis cluster resource name using the form: + * `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` where `location_id` + * refers to a GCP region. + * @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 specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   cloudRedisClusterClient.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 specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudRedisClusterClient.deleteClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final OperationCallable + deleteClusterOperationCallable() { + return stub.deleteClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a specific Redis cluster. Cluster stops serving and data is deleted. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   DeleteClusterRequest request =
+   *       DeleteClusterRequest.newBuilder()
+   *           .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.deleteClusterCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteClusterCallable() { + return stub.deleteClusterCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @param cluster Required. The cluster that is to be created. + * @param clusterId Required. The logical name of the Redis cluster in the customer project with + * the following restrictions: + *
    + *
  • Must contain only lowercase letters, numbers, and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-63 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project / location + *
+ * + * @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 Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Cluster cluster = Cluster.newBuilder().build();
+   *   String clusterId = "clusterId561939637";
+   *   Cluster response =
+   *       cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get();
+   * }
+   * }
+ * + * @param parent Required. The resource name of the cluster location using the form: + * `projects/{project_id}/locations/{location_id}` where `location_id` refers to a GCP region. + * @param cluster Required. The cluster that is to be created. + * @param clusterId Required. The logical name of the Redis cluster in the customer project with + * the following restrictions: + *
    + *
  • Must contain only lowercase letters, numbers, and hyphens. + *
  • Must start with a letter. + *
  • Must be between 1-63 characters. + *
  • Must end with a number or a letter. + *
  • Must be unique within the customer project / location + *
+ * + * @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 Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Cluster response = cloudRedisClusterClient.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 Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       cloudRedisClusterClient.createClusterOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Cluster response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createClusterOperationCallable() { + return stub.createClusterOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a Redis cluster based on the specified properties. The creation is executed + * asynchronously and callers may check the returned operation to track its progress. Once the + * operation is completed the Redis cluster will be fully functional. The completed + * longrunning.Operation will contain the new cluster object in the response field. + * + *

The returned operation is automatically deleted after a few hours, so there is no need to + * call DeleteOperation. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   CreateClusterRequest request =
+   *       CreateClusterRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setClusterId("clusterId561939637")
+   *           .setCluster(Cluster.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.createClusterCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createClusterCallable() { + return stub.createClusterCallable(); + } + + // 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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response =
+   *         cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = cloudRedisClusterClient.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future =
+   *       cloudRedisClusterClient.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 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterSettings.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterSettings.java new file mode 100644 index 000000000000..9348bba2fdff --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterSettings.java @@ -0,0 +1,319 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.stub.CloudRedisClusterStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +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 CloudRedisClusterClient}. + * + *

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

    + *
  • The default service address (redis.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
+ * CloudRedisClusterSettings.Builder cloudRedisClusterSettingsBuilder =
+ *     CloudRedisClusterSettings.newBuilder();
+ * cloudRedisClusterSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         cloudRedisClusterSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudRedisClusterSettings cloudRedisClusterSettings = cloudRedisClusterSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudRedisClusterSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listClusters. */ + public PagedCallSettings + listClustersSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).listClustersSettings(); + } + + /** Returns the object with the settings used for calls to getCluster. */ + public UnaryCallSettings getClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).getClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public UnaryCallSettings updateClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).updateClusterSettings(); + } + + /** Returns the object with the settings used for calls to updateCluster. */ + public OperationCallSettings + updateClusterOperationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).updateClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public UnaryCallSettings deleteClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).deleteClusterSettings(); + } + + /** Returns the object with the settings used for calls to deleteCluster. */ + public OperationCallSettings deleteClusterOperationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).deleteClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public UnaryCallSettings createClusterSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).createClusterSettings(); + } + + /** Returns the object with the settings used for calls to createCluster. */ + public OperationCallSettings + createClusterOperationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).createClusterOperationSettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((CloudRedisClusterStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final CloudRedisClusterSettings create(CloudRedisClusterStubSettings stub) + throws IOException { + return new CloudRedisClusterSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return CloudRedisClusterStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return CloudRedisClusterStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return CloudRedisClusterStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return CloudRedisClusterStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default gRPC ChannelProvider for this service. */ + public static InstantiatingGrpcChannelProvider.Builder defaultGrpcTransportProviderBuilder() { + return CloudRedisClusterStubSettings.defaultGrpcTransportProviderBuilder(); + } + + /** Returns a builder for the default REST ChannelProvider for this service. */ + @BetaApi + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return CloudRedisClusterStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return CloudRedisClusterStubSettings.defaultTransportChannelProvider(); + } + + @BetaApi("The surface for customizing headers is not stable yet and may change in the future.") + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudRedisClusterStubSettings.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 CloudRedisClusterSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for CloudRedisClusterSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(CloudRedisClusterStubSettings.newBuilder(clientContext)); + } + + protected Builder(CloudRedisClusterSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(CloudRedisClusterStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(CloudRedisClusterStubSettings.newBuilder()); + } + + @BetaApi + private static Builder createHttpJsonDefault() { + return new Builder(CloudRedisClusterStubSettings.newHttpJsonBuilder()); + } + + public CloudRedisClusterStubSettings.Builder getStubSettingsBuilder() { + return ((CloudRedisClusterStubSettings.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 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 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 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 CloudRedisClusterSettings build() throws IOException { + return new CloudRedisClusterSettings(this); + } + } +} diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/gapic_metadata.json b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..445e44142736 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/gapic_metadata.json @@ -0,0 +1,39 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.redis.cluster.v1beta1", + "libraryPackage": "com.google.cloud.redis.cluster.v1beta1", + "services": { + "CloudRedisCluster": { + "clients": { + "grpc": { + "libraryClient": "CloudRedisClusterClient", + "rpcs": { + "CreateCluster": { + "methods": ["createClusterAsync", "createClusterAsync", "createClusterAsync", "createClusterOperationCallable", "createClusterCallable"] + }, + "DeleteCluster": { + "methods": ["deleteClusterAsync", "deleteClusterAsync", "deleteClusterAsync", "deleteClusterOperationCallable", "deleteClusterCallable"] + }, + "GetCluster": { + "methods": ["getCluster", "getCluster", "getCluster", "getClusterCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListClusters": { + "methods": ["listClusters", "listClusters", "listClusters", "listClustersPagedCallable", "listClustersCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "UpdateCluster": { + "methods": ["updateClusterAsync", "updateClusterAsync", "updateClusterOperationCallable", "updateClusterCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/package-info.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/package-info.java new file mode 100644 index 000000000000..e2be32211c24 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/package-info.java @@ -0,0 +1,71 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Google Cloud Memorystore for Redis API + * + *

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

======================= CloudRedisClusterClient ======================= + * + *

Service Description: Configures and manages Cloud Memorystore for Redis clusters + * + *

Google Cloud Memorystore for Redis Cluster + * + *

The `redis.googleapis.com` service implements the Google Cloud Memorystore for Redis API and + * defines the following resource model for managing Redis clusters: + * + *

    + *
  • The service works with a collection of cloud projects, named: `/projects/*` + *
  • Each project has a collection of available locations, named: `/locations/*` + *
  • Each location has a collection of Redis clusters, named: `/clusters/*` + *
  • As such, Redis clusters are resources of the form: + * `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` + *
+ * + *

Note that location_id must be a GCP `region`; for example: + * + *

    + *
  • `projects/redpepper-1290/locations/us-central1/clusters/my-redis` + *
+ * + *

We use API version selector for Flex APIs + * + *

    + *
  • The versioning strategy is release-based versioning + *
  • Our backend CLH only deals with the superset version (called v1main) + *
  • Existing backend for Redis Gen1 and MRR is not touched. + *
  • More details in go/redis-flex-api-versioning + *
+ * + *

Sample for CloudRedisClusterClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) {
+ *   ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
+ *   Cluster response = cloudRedisClusterClient.getCluster(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.redis.cluster.v1beta1; + +import javax.annotation.Generated; diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/CloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/CloudRedisClusterStub.java new file mode 100644 index 000000000000..82956b6e4607 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/CloudRedisClusterStub.java @@ -0,0 +1,112 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.stub; + +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.OperationsStub; +import com.google.protobuf.Any; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the CloudRedisCluster service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class CloudRedisClusterStub 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 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 createClusterOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterOperationCallable()"); + } + + public UnaryCallable createClusterCallable() { + throw new UnsupportedOperationException("Not implemented: createClusterCallable()"); + } + + 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/CloudRedisClusterStubSettings.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/CloudRedisClusterStubSettings.java new file mode 100644 index 000000000000..045bc3764483 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/CloudRedisClusterStubSettings.java @@ -0,0 +1,737 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.stub; + +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest; +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.Any; +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 CloudRedisClusterStub}. + * + *

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

    + *
  • The default service address (redis.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
+ * CloudRedisClusterStubSettings.Builder cloudRedisClusterSettingsBuilder =
+ *     CloudRedisClusterStubSettings.newBuilder();
+ * cloudRedisClusterSettingsBuilder
+ *     .getClusterSettings()
+ *     .setRetrySettings(
+ *         cloudRedisClusterSettingsBuilder
+ *             .getClusterSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setTotalTimeout(Duration.ofSeconds(30))
+ *             .build());
+ * CloudRedisClusterStubSettings cloudRedisClusterSettings =
+ *     cloudRedisClusterSettingsBuilder.build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class CloudRedisClusterStubSettings 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 updateClusterSettings; + private final OperationCallSettings + updateClusterOperationSettings; + private final UnaryCallSettings deleteClusterSettings; + private final OperationCallSettings + deleteClusterOperationSettings; + private final UnaryCallSettings createClusterSettings; + private final OperationCallSettings + createClusterOperationSettings; + 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_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< + 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 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 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 listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return listLocationsSettings; + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return getLocationSettings; + } + + public CloudRedisClusterStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(GrpcTransportChannel.getGrpcTransportName())) { + return GrpcCloudRedisClusterStub.create(this); + } + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonCloudRedisClusterStub.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 "redis.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "redis.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(CloudRedisClusterStubSettings.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(CloudRedisClusterStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return CloudRedisClusterStubSettings.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 CloudRedisClusterStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listClustersSettings = settingsBuilder.listClustersSettings().build(); + getClusterSettings = settingsBuilder.getClusterSettings().build(); + updateClusterSettings = settingsBuilder.updateClusterSettings().build(); + updateClusterOperationSettings = settingsBuilder.updateClusterOperationSettings().build(); + deleteClusterSettings = settingsBuilder.deleteClusterSettings().build(); + deleteClusterOperationSettings = settingsBuilder.deleteClusterOperationSettings().build(); + createClusterSettings = settingsBuilder.createClusterSettings().build(); + createClusterOperationSettings = settingsBuilder.createClusterOperationSettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for CloudRedisClusterStubSettings. */ + 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 updateClusterSettings; + private final OperationCallSettings.Builder + updateClusterOperationSettings; + private final UnaryCallSettings.Builder deleteClusterSettings; + private final OperationCallSettings.Builder + deleteClusterOperationSettings; + private final UnaryCallSettings.Builder createClusterSettings; + private final OperationCallSettings.Builder + createClusterOperationSettings; + 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( + "no_retry_0_codes", ImmutableSet.copyOf(Lists.newArrayList())); + definitions.put("no_retry_codes", ImmutableSet.copyOf(Lists.newArrayList())); + RETRYABLE_CODE_DEFINITIONS = definitions.build(); + } + + private static final ImmutableMap RETRY_PARAM_DEFINITIONS; + + static { + ImmutableMap.Builder definitions = ImmutableMap.builder(); + RetrySettings settings = null; + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeout(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofMillis(600000L)) + .setTotalTimeout(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_0_params", settings); + settings = RetrySettings.newBuilder().setRpcTimeoutMultiplier(1.0).build(); + definitions.put("no_retry_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(); + updateClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateClusterOperationSettings = OperationCallSettings.newBuilder(); + deleteClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteClusterOperationSettings = OperationCallSettings.newBuilder(); + createClusterSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createClusterOperationSettings = OperationCallSettings.newBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + updateClusterSettings, + deleteClusterSettings, + createClusterSettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(CloudRedisClusterStubSettings settings) { + super(settings); + + listClustersSettings = settings.listClustersSettings.toBuilder(); + getClusterSettings = settings.getClusterSettings.toBuilder(); + updateClusterSettings = settings.updateClusterSettings.toBuilder(); + updateClusterOperationSettings = settings.updateClusterOperationSettings.toBuilder(); + deleteClusterSettings = settings.deleteClusterSettings.toBuilder(); + deleteClusterOperationSettings = settings.deleteClusterOperationSettings.toBuilder(); + createClusterSettings = settings.createClusterSettings.toBuilder(); + createClusterOperationSettings = settings.createClusterOperationSettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listClustersSettings, + getClusterSettings, + updateClusterSettings, + deleteClusterSettings, + createClusterSettings, + 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("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .getClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .updateClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .deleteClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .createClusterSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .getLocationSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_params")); + + builder + .updateClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(7200000L)) + .build())); + + builder + .deleteClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(1200000L)) + .build())); + + builder + .createClusterOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_0_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Cluster.class)) + .setMetadataTransformer(ProtoOperationTransformers.MetadataTransformer.create(Any.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelay(Duration.ofMillis(60000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelay(Duration.ofMillis(360000L)) + .setInitialRpcTimeout(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ZERO) + .setTotalTimeout(Duration.ofMillis(7200000L)) + .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 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 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 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 CloudRedisClusterStubSettings build() throws IOException { + return new CloudRedisClusterStubSettings(this); + } + } +} diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/GrpcCloudRedisClusterCallableFactory.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/GrpcCloudRedisClusterCallableFactory.java new file mode 100644 index 000000000000..acf955328f7c --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/GrpcCloudRedisClusterCallableFactory.java @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.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 CloudRedisCluster service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudRedisClusterCallableFactory 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/GrpcCloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/GrpcCloudRedisClusterStub.java new file mode 100644 index 000000000000..8d0bbed31455 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/GrpcCloudRedisClusterStub.java @@ -0,0 +1,414 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.stub; + +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +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.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest; +import com.google.longrunning.Operation; +import com.google.longrunning.stub.GrpcOperationsStub; +import com.google.protobuf.Any; +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 CloudRedisCluster service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class GrpcCloudRedisClusterStub extends CloudRedisClusterStub { + private static final MethodDescriptor + listClustersMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.redis.cluster.v1beta1.CloudRedisCluster/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.redis.cluster.v1beta1.CloudRedisCluster/GetCluster") + .setRequestMarshaller(ProtoUtils.marshaller(GetClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Cluster.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + updateClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.redis.cluster.v1beta1.CloudRedisCluster/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.redis.cluster.v1beta1.CloudRedisCluster/DeleteCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(DeleteClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.getDefaultInstance())) + .build(); + + private static final MethodDescriptor + createClusterMethodDescriptor = + MethodDescriptor.newBuilder() + .setType(MethodDescriptor.MethodType.UNARY) + .setFullMethodName( + "google.cloud.redis.cluster.v1beta1.CloudRedisCluster/CreateCluster") + .setRequestMarshaller( + ProtoUtils.marshaller(CreateClusterRequest.getDefaultInstance())) + .setResponseMarshaller(ProtoUtils.marshaller(Operation.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 updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable deleteClusterOperationCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + 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 GrpcCloudRedisClusterStub create(CloudRedisClusterStubSettings settings) + throws IOException { + return new GrpcCloudRedisClusterStub(settings, ClientContext.create(settings)); + } + + public static final GrpcCloudRedisClusterStub create(ClientContext clientContext) + throws IOException { + return new GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings.newBuilder().build(), clientContext); + } + + public static final GrpcCloudRedisClusterStub create( + ClientContext clientContext, GrpcStubCallableFactory callableFactory) throws IOException { + return new GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of GrpcCloudRedisClusterStub, 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 GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new GrpcCloudRedisClusterCallableFactory()); + } + + /** + * Constructs an instance of GrpcCloudRedisClusterStub, 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 GrpcCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, + ClientContext clientContext, + GrpcStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.operationsStub = GrpcOperationsStub.create(clientContext, callableFactory); + + GrpcCallSettings listClustersTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings getClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings updateClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("cluster.name", String.valueOf(request.getCluster().getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings deleteClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings createClusterTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + GrpcCallSettings listLocationsTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + GrpcCallSettings getLocationTransportSettings = + GrpcCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.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.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.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + operationsStub); + 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 updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/HttpJsonCloudRedisClusterCallableFactory.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/HttpJsonCloudRedisClusterCallableFactory.java new file mode 100644 index 000000000000..8037d2fb7b48 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/HttpJsonCloudRedisClusterCallableFactory.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.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 CloudRedisCluster service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudRedisClusterCallableFactory + 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-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/HttpJsonCloudRedisClusterStub.java b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/HttpJsonCloudRedisClusterStub.java new file mode 100644 index 000000000000..317dca6fc592 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/java/com/google/cloud/redis/cluster/v1beta1/stub/HttpJsonCloudRedisClusterStub.java @@ -0,0 +1,672 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.stub; + +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListLocationsPagedResponse; + +import com.google.api.HttpRule; +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.RequestParamsBuilder; +import com.google.api.gax.rpc.UnaryCallable; +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.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.GetClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Any; +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 CloudRedisCluster service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonCloudRedisClusterStub extends CloudRedisClusterStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Cluster.getDescriptor()) + .add(Any.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listClustersMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.redis.cluster.v1beta1.CloudRedisCluster/ListClusters") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{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, "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.redis.cluster.v1beta1.CloudRedisCluster/GetCluster") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{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 + updateClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.redis.cluster.v1beta1.CloudRedisCluster/UpdateCluster") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{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, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + 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.redis.cluster.v1beta1.CloudRedisCluster/DeleteCluster") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{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, "requestId", request.getRequestId()); + 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 + createClusterMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.redis.cluster.v1beta1.CloudRedisCluster/CreateCluster") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{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, "$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 + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta1/{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( + "/v1beta1/{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 updateClusterCallable; + private final OperationCallable + updateClusterOperationCallable; + private final UnaryCallable deleteClusterCallable; + private final OperationCallable deleteClusterOperationCallable; + private final UnaryCallable createClusterCallable; + private final OperationCallable + createClusterOperationCallable; + 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 HttpJsonCloudRedisClusterStub create(CloudRedisClusterStubSettings settings) + throws IOException { + return new HttpJsonCloudRedisClusterStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonCloudRedisClusterStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings.newHttpJsonBuilder().build(), clientContext); + } + + public static final HttpJsonCloudRedisClusterStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings.newHttpJsonBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonCloudRedisClusterStub, 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 HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, ClientContext clientContext) throws IOException { + this(settings, clientContext, new HttpJsonCloudRedisClusterCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonCloudRedisClusterStub, 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 HttpJsonCloudRedisClusterStub( + CloudRedisClusterStubSettings settings, + ClientContext clientContext, + HttpJsonStubCallableFactory callableFactory) + throws IOException { + this.callableFactory = callableFactory; + this.httpJsonOperationsStub = + HttpJsonOperationsStub.create( + clientContext, + callableFactory, + typeRegistry, + ImmutableMap.builder() + .put( + "google.longrunning.Operations.CancelOperation", + HttpRule.newBuilder() + .setPost("/v1beta1/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1beta1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta1/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta1/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings listClustersTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listClustersMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("cluster.name", String.valueOf(request.getCluster().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createClusterTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createClusterMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + listLocationsTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listLocationsMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getLocationTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getLocationMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.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.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.createClusterCallable = + callableFactory.createUnaryCallable( + createClusterTransportSettings, settings.createClusterSettings(), clientContext); + this.createClusterOperationCallable = + callableFactory.createOperationCallable( + createClusterTransportSettings, + settings.createClusterOperationSettings(), + clientContext, + httpJsonOperationsStub); + 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(updateClusterMethodDescriptor); + methodDescriptors.add(deleteClusterMethodDescriptor); + methodDescriptors.add(createClusterMethodDescriptor); + 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 updateClusterCallable() { + return updateClusterCallable; + } + + @Override + public OperationCallable updateClusterOperationCallable() { + return updateClusterOperationCallable; + } + + @Override + public UnaryCallable deleteClusterCallable() { + return deleteClusterCallable; + } + + @Override + public OperationCallable deleteClusterOperationCallable() { + return deleteClusterOperationCallable; + } + + @Override + public UnaryCallable createClusterCallable() { + return createClusterCallable; + } + + @Override + public OperationCallable createClusterOperationCallable() { + return createClusterOperationCallable; + } + + @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-redis-cluster/google-cloud-redis-cluster/src/main/resources/META-INF/native-image/com.google.cloud.redis.cluster.v1/reflect-config.json b/java-redis-cluster/google-cloud-redis-cluster/src/main/resources/META-INF/native-image/com.google.cloud.redis.cluster.v1/reflect-config.json new file mode 100644 index 000000000000..60742c60e961 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/resources/META-INF/native-image/com.google.cloud.redis.cluster.v1/reflect-config.json @@ -0,0 +1,1559 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.AuthorizationMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.Cluster", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.Cluster$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.Cluster$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.Cluster$StateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.Cluster$StateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.Cluster$StateInfo$UpdateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.Cluster$StateInfo$UpdateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.CreateClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.CreateClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.DeleteClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.DeleteClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.DiscoveryEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.DiscoveryEndpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.GetClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.GetClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.ListClustersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.ListClustersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.ListClustersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.ListClustersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.PscConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.PscConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.PscConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.PscConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.TransitEncryptionMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.UpdateClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1.UpdateClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/main/resources/META-INF/native-image/com.google.cloud.redis.cluster.v1beta1/reflect-config.json b/java-redis-cluster/google-cloud-redis-cluster/src/main/resources/META-INF/native-image/com.google.cloud.redis.cluster.v1beta1/reflect-config.json new file mode 100644 index 000000000000..34f7688443fd --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/main/resources/META-INF/native-image/com.google.cloud.redis.cluster.v1beta1/reflect-config.json @@ -0,0 +1,1559 @@ +[ + { + "name": "com.google.api.ClientLibraryDestination", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibraryOrganization", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ClientLibrarySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CommonLanguageSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CppSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.CustomHttpPattern$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.DotnetSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldBehavior", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.GoSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Http$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.HttpRule$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.JavaSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.LaunchStage", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.MethodSettings$LongRunning$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.NodeSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PhpSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.Publishing$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$History", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceDescriptor$Style", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.ResourceReference$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.RubySettings$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.GetLocationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.ListLocationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.location.Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.AuthorizationMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.Cluster", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.Cluster$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.Cluster$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.Cluster$StateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.Cluster$StateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.Cluster$StateInfo$UpdateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.Cluster$StateInfo$UpdateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.GetClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.GetClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.ListClustersRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.ListClustersRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.ListClustersResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.ListClustersResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.PscConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.PscConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.PscConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.PscConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.CancelOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.DeleteOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.GetOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.ListOperationsResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.Operation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.OperationInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.longrunning.WaitOperationRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Any$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ExtensionRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$DescriptorProto$ReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumDescriptorProto$EnumReservedRange$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$EnumValueOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$Declaration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ExtensionRangeOptions$VerificationState", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Label", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldDescriptorProto$Type", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$CType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$JSType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionRetention", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$OptionTargetType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileDescriptorSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FileOptions$OptimizeMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Annotation$Semantic", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$GeneratedCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MessageOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$MethodOptions$IdempotencyLevel", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$OneofOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceDescriptorProto$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$ServiceOptions$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$SourceCodeInfo$Location$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$UninterpretedOption$NamePart$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Duration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Empty$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.FieldMask$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.Timestamp$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.rpc.Status$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + } +] \ No newline at end of file diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClientHttpJsonTest.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClientHttpJsonTest.java new file mode 100644 index 000000000000..28d3f0e38225 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClientHttpJsonTest.java @@ -0,0 +1,724 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1; + +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.stub.HttpJsonCloudRedisClusterStub; +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 CloudRedisClusterClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudRedisClusterClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudRedisClusterStub.getMethodDescriptors(), + CloudRedisClusterSettings.getDefaultEndpoint()); + CloudRedisClusterSettings settings = + CloudRedisClusterSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudRedisClusterSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudRedisClusterClient.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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 updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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 createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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 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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClientTest.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClientTest.java new file mode 100644 index 000000000000..3c1133f80f30 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterClientTest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1; + +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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 CloudRedisClusterClientTest { + private static MockCloudRedisCluster mockCloudRedisCluster; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudRedisClusterClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudRedisCluster = new MockCloudRedisCluster(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudRedisCluster, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudRedisClusterSettings settings = + CloudRedisClusterSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudRedisClusterClient.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(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + mockCloudRedisCluster.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + mockCloudRedisCluster.addResponse(expectedResponse); + + String name = "name3373707"; + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.addException(exception); + + try { + String name = "name3373707"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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(); + mockCloudRedisCluster.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.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(); + mockCloudRedisCluster.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.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 createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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 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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockCloudRedisCluster.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockCloudRedisCluster.java new file mode 100644 index 000000000000..83ddb9fdf5c7 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockCloudRedisCluster.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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 MockCloudRedisCluster implements MockGrpcService { + private final MockCloudRedisClusterImpl serviceImpl; + + public MockCloudRedisCluster() { + serviceImpl = new MockCloudRedisClusterImpl(); + } + + @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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockCloudRedisClusterImpl.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockCloudRedisClusterImpl.java new file mode 100644 index 000000000000..3a4671862ddc --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockCloudRedisClusterImpl.java @@ -0,0 +1,165 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1; + +import com.google.api.core.BetaApi; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterGrpc.CloudRedisClusterImplBase; +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 MockCloudRedisClusterImpl extends CloudRedisClusterImplBase { + private List requests; + private Queue responses; + + public MockCloudRedisClusterImpl() { + 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 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 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()))); + } + } +} diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockLocations.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockLocations.java new file mode 100644 index 000000000000..6a92a2de277d --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockLocationsImpl.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockLocationsImpl.java new file mode 100644 index 000000000000..32826107c2b9 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClientHttpJsonTest.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClientHttpJsonTest.java new file mode 100644 index 000000000000..ef5c9d10b1da --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClientHttpJsonTest.java @@ -0,0 +1,724 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.stub.HttpJsonCloudRedisClusterStub; +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 CloudRedisClusterClientHttpJsonTest { + private static MockHttpService mockService; + private static CloudRedisClusterClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonCloudRedisClusterStub.getMethodDescriptors(), + CloudRedisClusterSettings.getDefaultEndpoint()); + CloudRedisClusterSettings settings = + CloudRedisClusterSettings.newHttpJsonBuilder() + .setTransportChannelProvider( + CloudRedisClusterSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudRedisClusterClient.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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 updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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 createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.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 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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClientTest.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClientTest.java new file mode 100644 index 000000000000..d861c115571d --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterClientTest.java @@ -0,0 +1,654 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListClustersPagedResponse; +import static com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient.ListLocationsPagedResponse; + +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 CloudRedisClusterClientTest { + private static MockCloudRedisCluster mockCloudRedisCluster; + private static MockLocations mockLocations; + private static MockServiceHelper mockServiceHelper; + private LocalChannelProvider channelProvider; + private CloudRedisClusterClient client; + + @BeforeClass + public static void startStaticServer() { + mockCloudRedisCluster = new MockCloudRedisCluster(); + mockLocations = new MockLocations(); + mockServiceHelper = + new MockServiceHelper( + UUID.randomUUID().toString(), + Arrays.asList(mockCloudRedisCluster, mockLocations)); + mockServiceHelper.start(); + } + + @AfterClass + public static void stopServer() { + mockServiceHelper.stop(); + } + + @Before + public void setUp() throws IOException { + mockServiceHelper.reset(); + channelProvider = mockServiceHelper.createChannelProvider(); + CloudRedisClusterSettings settings = + CloudRedisClusterSettings.newBuilder() + .setTransportChannelProvider(channelProvider) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = CloudRedisClusterClient.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(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + mockCloudRedisCluster.addResponse(expectedResponse); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + mockCloudRedisCluster.addResponse(expectedResponse); + + String name = "name3373707"; + + Cluster actualResponse = client.getCluster(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.addException(exception); + + try { + String name = "name3373707"; + client.getCluster(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void updateClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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(); + mockCloudRedisCluster.addResponse(resultOperation); + + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.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(); + mockCloudRedisCluster.addResponse(resultOperation); + + String name = "name3373707"; + + client.deleteClusterAsync(name).get(); + + List actualRequests = mockCloudRedisCluster.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); + mockCloudRedisCluster.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 createClusterTest() throws Exception { + Cluster expectedResponse = + Cluster.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setAuthorizationMode(AuthorizationMode.forNumber(0)) + .setTransitEncryptionMode(TransitEncryptionMode.forNumber(0)) + .setSizeGb(2105542105) + .setShardCount(-495377042) + .addAllPscConfigs(new ArrayList()) + .addAllDiscoveryEndpoints(new ArrayList()) + .addAllPscConnections(new ArrayList()) + .setStateInfo(Cluster.StateInfo.newBuilder().build()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createClusterTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockCloudRedisCluster.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 = mockCloudRedisCluster.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); + mockCloudRedisCluster.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 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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockCloudRedisCluster.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockCloudRedisCluster.java new file mode 100644 index 000000000000..7c9865647681 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockCloudRedisCluster.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +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 MockCloudRedisCluster implements MockGrpcService { + private final MockCloudRedisClusterImpl serviceImpl; + + public MockCloudRedisCluster() { + serviceImpl = new MockCloudRedisClusterImpl(); + } + + @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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockCloudRedisClusterImpl.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockCloudRedisClusterImpl.java new file mode 100644 index 000000000000..d6b8e7a13ee7 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockCloudRedisClusterImpl.java @@ -0,0 +1,165 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +import com.google.api.core.BetaApi; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterGrpc.CloudRedisClusterImplBase; +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 MockCloudRedisClusterImpl extends CloudRedisClusterImplBase { + private List requests; + private Queue responses; + + public MockCloudRedisClusterImpl() { + 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 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 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()))); + } + } +} diff --git a/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockLocations.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockLocations.java new file mode 100644 index 000000000000..9bfc4789c38a --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockLocations.java @@ -0,0 +1,59 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +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-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockLocationsImpl.java b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockLocationsImpl.java new file mode 100644 index 000000000000..6055b2dc7f93 --- /dev/null +++ b/java-redis-cluster/google-cloud-redis-cluster/src/test/java/com/google/cloud/redis/cluster/v1beta1/MockLocationsImpl.java @@ -0,0 +1,105 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +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-redis-cluster/grpc-google-cloud-redis-cluster-v1/pom.xml b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1/pom.xml new file mode 100644 index 000000000000..7c861976ed07 --- /dev/null +++ b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1 + 0.0.1-SNAPSHOT + grpc-google-cloud-redis-cluster-v1 + GRPC library for google-cloud-redis-cluster + + com.google.cloud + google-cloud-redis-cluster-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-redis-cluster-v1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-redis-cluster/grpc-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterGrpc.java b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterGrpc.java new file mode 100644 index 000000000000..de56cd8685fb --- /dev/null +++ b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterGrpc.java @@ -0,0 +1,990 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.redis.cluster.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Configures and manages Cloud Memorystore for Redis clusters
+ * Google Cloud Memorystore for Redis Cluster
+ * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+ * for Redis API and defines the following resource model for managing Redis
+ * clusters:
+ * * The service works with a collection of cloud projects, named: `/projects/*`
+ * * Each project has a collection of available locations, named: `/locations/*`
+ * * Each location has a collection of Redis clusters, named: `/clusters/*`
+ * * As such, Redis clusters are resources of the form:
+ *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+ * Note that location_id must be a GCP `region`; for example:
+ * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+ * We use API version selector for Flex APIs
+ * * The versioning strategy is release-based versioning
+ * * Our backend CLH only deals with the superset version (called v1main)
+ * * Existing backend for Redis Gen1 and MRR is not touched.
+ * * More details in go/redis-flex-api-versioning
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudRedisClusterGrpc { + + private CloudRedisClusterGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.redis.cluster.v1.CloudRedisCluster"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.ListClustersRequest, + com.google.cloud.redis.cluster.v1.ListClustersResponse> + getListClustersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClusters", + requestType = com.google.cloud.redis.cluster.v1.ListClustersRequest.class, + responseType = com.google.cloud.redis.cluster.v1.ListClustersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.ListClustersRequest, + com.google.cloud.redis.cluster.v1.ListClustersResponse> + getListClustersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.ListClustersRequest, + com.google.cloud.redis.cluster.v1.ListClustersResponse> + getListClustersMethod; + if ((getListClustersMethod = CloudRedisClusterGrpc.getListClustersMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getListClustersMethod = CloudRedisClusterGrpc.getListClustersMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1.ListClustersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.cluster.v1.ListClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("ListClusters")) + .build(); + } + } + } + return getListClustersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.GetClusterRequest, + com.google.cloud.redis.cluster.v1.Cluster> + getGetClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCluster", + requestType = com.google.cloud.redis.cluster.v1.GetClusterRequest.class, + responseType = com.google.cloud.redis.cluster.v1.Cluster.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.GetClusterRequest, + com.google.cloud.redis.cluster.v1.Cluster> + getGetClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.GetClusterRequest, + com.google.cloud.redis.cluster.v1.Cluster> + getGetClusterMethod; + if ((getGetClusterMethod = CloudRedisClusterGrpc.getGetClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getGetClusterMethod = CloudRedisClusterGrpc.getGetClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1.GetClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("GetCluster")) + .build(); + } + } + } + return getGetClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCluster", + requestType = com.google.cloud.redis.cluster.v1.UpdateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.UpdateClusterRequest, com.google.longrunning.Operation> + getUpdateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.UpdateClusterRequest, + com.google.longrunning.Operation> + getUpdateClusterMethod; + if ((getUpdateClusterMethod = CloudRedisClusterGrpc.getUpdateClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getUpdateClusterMethod = CloudRedisClusterGrpc.getUpdateClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1.UpdateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("UpdateCluster")) + .build(); + } + } + } + return getUpdateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCluster", + requestType = com.google.cloud.redis.cluster.v1.DeleteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.DeleteClusterRequest, com.google.longrunning.Operation> + getDeleteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.DeleteClusterRequest, + com.google.longrunning.Operation> + getDeleteClusterMethod; + if ((getDeleteClusterMethod = CloudRedisClusterGrpc.getDeleteClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getDeleteClusterMethod = CloudRedisClusterGrpc.getDeleteClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1.DeleteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("DeleteCluster")) + .build(); + } + } + } + return getDeleteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCluster", + requestType = com.google.cloud.redis.cluster.v1.CreateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.CreateClusterRequest, com.google.longrunning.Operation> + getCreateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1.CreateClusterRequest, + com.google.longrunning.Operation> + getCreateClusterMethod; + if ((getCreateClusterMethod = CloudRedisClusterGrpc.getCreateClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getCreateClusterMethod = CloudRedisClusterGrpc.getCreateClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1.CreateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("CreateCluster")) + .build(); + } + } + } + return getCreateClusterMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudRedisClusterStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudRedisClusterStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterStub(channel, callOptions); + } + }; + return CloudRedisClusterStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudRedisClusterBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudRedisClusterBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterBlockingStub(channel, callOptions); + } + }; + return CloudRedisClusterBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudRedisClusterFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudRedisClusterFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterFutureStub(channel, callOptions); + } + }; + return CloudRedisClusterFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + default void listClusters( + com.google.cloud.redis.cluster.v1.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClustersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + default void getCluster( + com.google.cloud.redis.cluster.v1.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + default void updateCluster( + com.google.cloud.redis.cluster.v1.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + default void deleteCluster( + com.google.cloud.redis.cluster.v1.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + default void createCluster( + com.google.cloud.redis.cluster.v1.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClusterMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public abstract static class CloudRedisClusterImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudRedisClusterGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public static final class CloudRedisClusterStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudRedisClusterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisClusterStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public void listClusters( + com.google.cloud.redis.cluster.v1.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.redis.cluster.v1.GetClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public void updateCluster( + com.google.cloud.redis.cluster.v1.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.redis.cluster.v1.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public void createCluster( + com.google.cloud.redis.cluster.v1.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public static final class CloudRedisClusterBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudRedisClusterBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisClusterBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public com.google.cloud.redis.cluster.v1.ListClustersResponse listClusters( + com.google.cloud.redis.cluster.v1.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + public com.google.cloud.redis.cluster.v1.Cluster getCluster( + com.google.cloud.redis.cluster.v1.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public com.google.longrunning.Operation updateCluster( + com.google.cloud.redis.cluster.v1.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteCluster( + com.google.cloud.redis.cluster.v1.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public com.google.longrunning.Operation createCluster( + com.google.cloud.redis.cluster.v1.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public static final class CloudRedisClusterFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudRedisClusterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisClusterFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.redis.cluster.v1.ListClustersResponse> + listClusters(com.google.cloud.redis.cluster.v1.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.redis.cluster.v1.Cluster> + getCluster(com.google.cloud.redis.cluster.v1.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCluster(com.google.cloud.redis.cluster.v1.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCluster(com.google.cloud.redis.cluster.v1.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createCluster(com.google.cloud.redis.cluster.v1.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CLUSTERS = 0; + private static final int METHODID_GET_CLUSTER = 1; + private static final int METHODID_UPDATE_CLUSTER = 2; + private static final int METHODID_DELETE_CLUSTER = 3; + private static final int METHODID_CREATE_CLUSTER = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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.redis.cluster.v1.ListClustersRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_GET_CLUSTER: + serviceImpl.getCluster( + (com.google.cloud.redis.cluster.v1.GetClusterRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_CLUSTER: + serviceImpl.updateCluster( + (com.google.cloud.redis.cluster.v1.UpdateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLUSTER: + serviceImpl.deleteCluster( + (com.google.cloud.redis.cluster.v1.DeleteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_CLUSTER: + serviceImpl.createCluster( + (com.google.cloud.redis.cluster.v1.CreateClusterRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1.ListClustersRequest, + com.google.cloud.redis.cluster.v1.ListClustersResponse>( + service, METHODID_LIST_CLUSTERS))) + .addMethod( + getGetClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1.GetClusterRequest, + com.google.cloud.redis.cluster.v1.Cluster>(service, METHODID_GET_CLUSTER))) + .addMethod( + getUpdateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1.UpdateClusterRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_CLUSTER))) + .addMethod( + getDeleteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1.DeleteClusterRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_CLUSTER))) + .addMethod( + getCreateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1.CreateClusterRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_CLUSTER))) + .build(); + } + + private abstract static class CloudRedisClusterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudRedisClusterBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudRedisCluster"); + } + } + + private static final class CloudRedisClusterFileDescriptorSupplier + extends CloudRedisClusterBaseDescriptorSupplier { + CloudRedisClusterFileDescriptorSupplier() {} + } + + private static final class CloudRedisClusterMethodDescriptorSupplier + extends CloudRedisClusterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudRedisClusterMethodDescriptorSupplier(java.lang.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 (CloudRedisClusterGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudRedisClusterFileDescriptorSupplier()) + .addMethod(getListClustersMethod()) + .addMethod(getGetClusterMethod()) + .addMethod(getUpdateClusterMethod()) + .addMethod(getDeleteClusterMethod()) + .addMethod(getCreateClusterMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-redis-cluster/grpc-google-cloud-redis-cluster-v1beta1/pom.xml b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1beta1/pom.xml new file mode 100644 index 000000000000..2f531d3e8d89 --- /dev/null +++ b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1beta1/pom.xml @@ -0,0 +1,45 @@ + + 4.0.0 + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1beta1 + 0.0.1-SNAPSHOT + grpc-google-cloud-redis-cluster-v1beta1 + GRPC library for google-cloud-redis-cluster + + com.google.cloud + google-cloud-redis-cluster-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-redis-cluster-v1beta1 + + + com.google.guava + guava + + + \ No newline at end of file diff --git a/java-redis-cluster/grpc-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterGrpc.java b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterGrpc.java new file mode 100644 index 000000000000..269fabee2663 --- /dev/null +++ b/java-redis-cluster/grpc-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterGrpc.java @@ -0,0 +1,999 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.google.cloud.redis.cluster.v1beta1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; + +/** + * + * + *
+ * Configures and manages Cloud Memorystore for Redis clusters
+ * Google Cloud Memorystore for Redis Cluster
+ * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+ * for Redis API and defines the following resource model for managing Redis
+ * clusters:
+ * * The service works with a collection of cloud projects, named: `/projects/*`
+ * * Each project has a collection of available locations, named: `/locations/*`
+ * * Each location has a collection of Redis clusters, named: `/clusters/*`
+ * * As such, Redis clusters are resources of the form:
+ *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+ * Note that location_id must be a GCP `region`; for example:
+ * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+ * We use API version selector for Flex APIs
+ * * The versioning strategy is release-based versioning
+ * * Our backend CLH only deals with the superset version (called v1main)
+ * * Existing backend for Redis Gen1 and MRR is not touched.
+ * * More details in go/redis-flex-api-versioning
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler", + comments = "Source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto") +@io.grpc.stub.annotations.GrpcGenerated +public final class CloudRedisClusterGrpc { + + private CloudRedisClusterGrpc() {} + + public static final java.lang.String SERVICE_NAME = + "google.cloud.redis.cluster.v1beta1.CloudRedisCluster"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest, + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse> + getListClustersMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListClusters", + requestType = com.google.cloud.redis.cluster.v1beta1.ListClustersRequest.class, + responseType = com.google.cloud.redis.cluster.v1beta1.ListClustersResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest, + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse> + getListClustersMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest, + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse> + getListClustersMethod; + if ((getListClustersMethod = CloudRedisClusterGrpc.getListClustersMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getListClustersMethod = CloudRedisClusterGrpc.getListClustersMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1beta1.ListClustersRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse + .getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("ListClusters")) + .build(); + } + } + } + return getListClustersMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest, + com.google.cloud.redis.cluster.v1beta1.Cluster> + getGetClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetCluster", + requestType = com.google.cloud.redis.cluster.v1beta1.GetClusterRequest.class, + responseType = com.google.cloud.redis.cluster.v1beta1.Cluster.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest, + com.google.cloud.redis.cluster.v1beta1.Cluster> + getGetClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest, + com.google.cloud.redis.cluster.v1beta1.Cluster> + getGetClusterMethod; + if ((getGetClusterMethod = CloudRedisClusterGrpc.getGetClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getGetClusterMethod = CloudRedisClusterGrpc.getGetClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1beta1.GetClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("GetCluster")) + .build(); + } + } + } + return getGetClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest, + com.google.longrunning.Operation> + getUpdateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "UpdateCluster", + requestType = com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest, + com.google.longrunning.Operation> + getUpdateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest, + com.google.longrunning.Operation> + getUpdateClusterMethod; + if ((getUpdateClusterMethod = CloudRedisClusterGrpc.getUpdateClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getUpdateClusterMethod = CloudRedisClusterGrpc.getUpdateClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1beta1.UpdateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("UpdateCluster")) + .build(); + } + } + } + return getUpdateClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest, + com.google.longrunning.Operation> + getDeleteClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteCluster", + requestType = com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest, + com.google.longrunning.Operation> + getDeleteClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest, + com.google.longrunning.Operation> + getDeleteClusterMethod; + if ((getDeleteClusterMethod = CloudRedisClusterGrpc.getDeleteClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getDeleteClusterMethod = CloudRedisClusterGrpc.getDeleteClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1beta1.DeleteClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("DeleteCluster")) + .build(); + } + } + } + return getDeleteClusterMethod; + } + + private static volatile io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest, + com.google.longrunning.Operation> + getCreateClusterMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "CreateCluster", + requestType = com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest.class, + responseType = com.google.longrunning.Operation.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest, + com.google.longrunning.Operation> + getCreateClusterMethod() { + io.grpc.MethodDescriptor< + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest, + com.google.longrunning.Operation> + getCreateClusterMethod; + if ((getCreateClusterMethod = CloudRedisClusterGrpc.getCreateClusterMethod) == null) { + synchronized (CloudRedisClusterGrpc.class) { + if ((getCreateClusterMethod = CloudRedisClusterGrpc.getCreateClusterMethod) == null) { + CloudRedisClusterGrpc.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.redis.cluster.v1beta1.CreateClusterRequest + .getDefaultInstance())) + .setResponseMarshaller( + io.grpc.protobuf.ProtoUtils.marshaller( + com.google.longrunning.Operation.getDefaultInstance())) + .setSchemaDescriptor( + new CloudRedisClusterMethodDescriptorSupplier("CreateCluster")) + .build(); + } + } + } + return getCreateClusterMethod; + } + + /** Creates a new async stub that supports all call types for the service */ + public static CloudRedisClusterStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudRedisClusterStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterStub(channel, callOptions); + } + }; + return CloudRedisClusterStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static CloudRedisClusterBlockingStub newBlockingStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudRedisClusterBlockingStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterBlockingStub(channel, callOptions); + } + }; + return CloudRedisClusterBlockingStub.newStub(factory, channel); + } + + /** Creates a new ListenableFuture-style stub that supports unary calls on the service */ + public static CloudRedisClusterFutureStub newFutureStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public CloudRedisClusterFutureStub newStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterFutureStub(channel, callOptions); + } + }; + return CloudRedisClusterFutureStub.newStub(factory, channel); + } + + /** + * + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public interface AsyncService { + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + default void listClusters( + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getListClustersMethod(), responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + default void getCluster( + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + default void updateCluster( + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getUpdateClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + default void deleteCluster( + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getDeleteClusterMethod(), responseObserver); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + default void createCluster( + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall( + getCreateClusterMethod(), responseObserver); + } + } + + /** + * Base class for the server implementation of the service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public abstract static class CloudRedisClusterImplBase + implements io.grpc.BindableService, AsyncService { + + @java.lang.Override + public final io.grpc.ServerServiceDefinition bindService() { + return CloudRedisClusterGrpc.bindService(this); + } + } + + /** + * A stub to allow clients to do asynchronous rpc calls to service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public static final class CloudRedisClusterStub + extends io.grpc.stub.AbstractAsyncStub { + private CloudRedisClusterStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisClusterStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public void listClusters( + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + public void getCluster( + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest request, + io.grpc.stub.StreamObserver + responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request, responseObserver); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public void updateCluster( + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + public void deleteCluster( + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), + request, + responseObserver); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public void createCluster( + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), + request, + responseObserver); + } + } + + /** + * A stub to allow clients to do synchronous rpc calls to service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public static final class CloudRedisClusterBlockingStub + extends io.grpc.stub.AbstractBlockingStub { + private CloudRedisClusterBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisClusterBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterBlockingStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public com.google.cloud.redis.cluster.v1beta1.ListClustersResponse listClusters( + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getListClustersMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + public com.google.cloud.redis.cluster.v1beta1.Cluster getCluster( + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public com.google.longrunning.Operation updateCluster( + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getUpdateClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + public com.google.longrunning.Operation deleteCluster( + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getDeleteClusterMethod(), getCallOptions(), request); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public com.google.longrunning.Operation createCluster( + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getCreateClusterMethod(), getCallOptions(), request); + } + } + + /** + * A stub to allow clients to do ListenableFuture-style rpc calls to service CloudRedisCluster. + * + *
+   * Configures and manages Cloud Memorystore for Redis clusters
+   * Google Cloud Memorystore for Redis Cluster
+   * The `redis.googleapis.com` service implements the Google Cloud Memorystore
+   * for Redis API and defines the following resource model for managing Redis
+   * clusters:
+   * * The service works with a collection of cloud projects, named: `/projects/*`
+   * * Each project has a collection of available locations, named: `/locations/*`
+   * * Each location has a collection of Redis clusters, named: `/clusters/*`
+   * * As such, Redis clusters are resources of the form:
+   *   `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}`
+   * Note that location_id must be a GCP `region`; for example:
+   * * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
+   * We use API version selector for Flex APIs
+   * * The versioning strategy is release-based versioning
+   * * Our backend CLH only deals with the superset version (called v1main)
+   * * Existing backend for Redis Gen1 and MRR is not touched.
+   * * More details in go/redis-flex-api-versioning
+   * 
+ */ + public static final class CloudRedisClusterFutureStub + extends io.grpc.stub.AbstractFutureStub { + private CloudRedisClusterFutureStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected CloudRedisClusterFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new CloudRedisClusterFutureStub(channel, callOptions); + } + + /** + * + * + *
+     * Lists all Redis clusters owned by a project in either the specified
+     * location (region) or all locations.
+     * The location should have the following format:
+     * * `projects/{project_id}/locations/{location_id}`
+     * If `location_id` is specified as `-` (wildcard), then all regions
+     * available to the project are queried, and the results are aggregated.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse> + listClusters(com.google.cloud.redis.cluster.v1beta1.ListClustersRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getListClustersMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Gets the details of a specific Redis cluster.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture< + com.google.cloud.redis.cluster.v1beta1.Cluster> + getCluster(com.google.cloud.redis.cluster.v1beta1.GetClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Updates the metadata and configuration of a specific Redis cluster.
+     * Completed longrunning.Operation will contain the new cluster object
+     * in the response field. The returned operation is automatically deleted
+     * after a few hours, so there is no need to call DeleteOperation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + updateCluster(com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getUpdateClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Deletes a specific Redis cluster. Cluster stops serving and data is
+     * deleted.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + deleteCluster(com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getDeleteClusterMethod(), getCallOptions()), request); + } + + /** + * + * + *
+     * Creates a Redis cluster based on the specified properties.
+     * The creation is executed asynchronously and callers may check the returned
+     * operation to track its progress. Once the operation is completed the Redis
+     * cluster will be fully functional. The completed longrunning.Operation will
+     * contain the new cluster object in the response field.
+     * The returned operation is automatically deleted after a few hours, so there
+     * is no need to call DeleteOperation.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture + createCluster(com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getCreateClusterMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_CLUSTERS = 0; + private static final int METHODID_GET_CLUSTER = 1; + private static final int METHODID_UPDATE_CLUSTER = 2; + private static final int METHODID_DELETE_CLUSTER = 3; + private static final int METHODID_CREATE_CLUSTER = 4; + + private static final class MethodHandlers + implements io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AsyncService serviceImpl; + private final int methodId; + + MethodHandlers(AsyncService 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.redis.cluster.v1beta1.ListClustersRequest) request, + (io.grpc.stub.StreamObserver< + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse>) + responseObserver); + break; + case METHODID_GET_CLUSTER: + serviceImpl.getCluster( + (com.google.cloud.redis.cluster.v1beta1.GetClusterRequest) request, + (io.grpc.stub.StreamObserver) + responseObserver); + break; + case METHODID_UPDATE_CLUSTER: + serviceImpl.updateCluster( + (com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CLUSTER: + serviceImpl.deleteCluster( + (com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_CREATE_CLUSTER: + serviceImpl.createCluster( + (com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest) 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(); + } + } + } + + public static final io.grpc.ServerServiceDefinition bindService(AsyncService service) { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListClustersMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest, + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse>( + service, METHODID_LIST_CLUSTERS))) + .addMethod( + getGetClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest, + com.google.cloud.redis.cluster.v1beta1.Cluster>(service, METHODID_GET_CLUSTER))) + .addMethod( + getUpdateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest, + com.google.longrunning.Operation>(service, METHODID_UPDATE_CLUSTER))) + .addMethod( + getDeleteClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest, + com.google.longrunning.Operation>(service, METHODID_DELETE_CLUSTER))) + .addMethod( + getCreateClusterMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest, + com.google.longrunning.Operation>(service, METHODID_CREATE_CLUSTER))) + .build(); + } + + private abstract static class CloudRedisClusterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, + io.grpc.protobuf.ProtoServiceDescriptorSupplier { + CloudRedisClusterBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("CloudRedisCluster"); + } + } + + private static final class CloudRedisClusterFileDescriptorSupplier + extends CloudRedisClusterBaseDescriptorSupplier { + CloudRedisClusterFileDescriptorSupplier() {} + } + + private static final class CloudRedisClusterMethodDescriptorSupplier + extends CloudRedisClusterBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final java.lang.String methodName; + + CloudRedisClusterMethodDescriptorSupplier(java.lang.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 (CloudRedisClusterGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = + result = + io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new CloudRedisClusterFileDescriptorSupplier()) + .addMethod(getListClustersMethod()) + .addMethod(getGetClusterMethod()) + .addMethod(getUpdateClusterMethod()) + .addMethod(getDeleteClusterMethod()) + .addMethod(getCreateClusterMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/java-redis-cluster/owlbot.py b/java-redis-cluster/owlbot.py new file mode 100644 index 000000000000..03c0f6686d3f --- /dev/null +++ b/java-redis-cluster/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-redis-cluster/pom.xml b/java-redis-cluster/pom.xml new file mode 100644 index 000000000000..0150444898a2 --- /dev/null +++ b/java-redis-cluster/pom.xml @@ -0,0 +1,66 @@ + + + 4.0.0 + com.google.cloud + google-cloud-redis-cluster-parent + pom + 0.0.1-SNAPSHOT + Google Google Cloud Memorystore for Redis API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.23.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-redis-cluster-parent + + + + + + com.google.cloud + google-cloud-redis-cluster + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + grpc-google-cloud-redis-cluster-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-redis-cluster-v1beta1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-redis-cluster-v1 + 0.0.1-SNAPSHOT + + + + + + google-cloud-redis-cluster + grpc-google-cloud-redis-cluster-v1 + grpc-google-cloud-redis-cluster-v1beta1 + proto-google-cloud-redis-cluster-v1beta1 + proto-google-cloud-redis-cluster-v1 + google-cloud-redis-cluster-bom + + + diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/clirr-ignored-differences.xml b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..941a5efda320 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/redis/cluster/v1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/redis/cluster/v1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/redis/cluster/v1/*OrBuilder + boolean has*(*) + + diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/pom.xml b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/pom.xml new file mode 100644 index 000000000000..078227fe3b6a --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-redis-cluster-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-redis-cluster-v1 + Proto library for google-cloud-redis-cluster + + com.google.cloud + google-cloud-redis-cluster-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-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/AuthorizationMode.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/AuthorizationMode.java new file mode 100644 index 000000000000..139bd98ba029 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/AuthorizationMode.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Available authorization mode of a Redis cluster.
+ * 
+ * + * Protobuf enum {@code google.cloud.redis.cluster.v1.AuthorizationMode} + */ +public enum AuthorizationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not set.
+   * 
+ * + * AUTH_MODE_UNSPECIFIED = 0; + */ + AUTH_MODE_UNSPECIFIED(0), + /** + * + * + *
+   * IAM basic authorization mode
+   * 
+ * + * AUTH_MODE_IAM_AUTH = 1; + */ + AUTH_MODE_IAM_AUTH(1), + /** + * + * + *
+   * Authorization disabled mode
+   * 
+ * + * AUTH_MODE_DISABLED = 2; + */ + AUTH_MODE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not set.
+   * 
+ * + * AUTH_MODE_UNSPECIFIED = 0; + */ + public static final int AUTH_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * IAM basic authorization mode
+   * 
+ * + * AUTH_MODE_IAM_AUTH = 1; + */ + public static final int AUTH_MODE_IAM_AUTH_VALUE = 1; + /** + * + * + *
+   * Authorization disabled mode
+   * 
+ * + * AUTH_MODE_DISABLED = 2; + */ + public static final int AUTH_MODE_DISABLED_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 AuthorizationMode 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 AuthorizationMode forNumber(int value) { + switch (value) { + case 0: + return AUTH_MODE_UNSPECIFIED; + case 1: + return AUTH_MODE_IAM_AUTH; + case 2: + return AUTH_MODE_DISABLED; + 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 AuthorizationMode findValueByNumber(int number) { + return AuthorizationMode.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.redis.cluster.v1.CloudRedisClusterProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AuthorizationMode[] VALUES = values(); + + public static AuthorizationMode 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 AuthorizationMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.redis.cluster.v1.AuthorizationMode) +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterProto.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterProto.java new file mode 100644 index 000000000000..d0260702fac5 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CloudRedisClusterProto.java @@ -0,0 +1,368 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public final class CloudRedisClusterProto { + private CloudRedisClusterProto() {} + + 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_redis_cluster_v1_CreateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_Cluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_PscConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_PscConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_PscConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1_PscConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_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 = { + "\n7google/cloud/redis/cluster/v1/cloud_re" + + "dis_cluster.proto\022\035google.cloud.redis.cl" + + "uster.v1\032\034google/api/annotations.proto\032\027" + + "google/api/client.proto\032\037google/api/fiel" + + "d_behavior.proto\032\031google/api/resource.pr" + + "oto\032#google/longrunning/operations.proto" + + "\032\031google/protobuf/any.proto\032\033google/prot" + + "obuf/empty.proto\032 google/protobuf/field_" + + "mask.proto\032\037google/protobuf/timestamp.pr" + + "oto\"\277\001\n\024CreateClusterRequest\022:\n\006parent\030\001" + + " \001(\tB*\342A\001\002\372A#\n!locations.googleapis.com/" + + "Location\022\030\n\ncluster_id\030\002 \001(\tB\004\342A\001\002\022=\n\007cl" + + "uster\030\003 \001(\0132&.google.cloud.redis.cluster" + + ".v1.ClusterB\004\342A\001\002\022\022\n\nrequest_id\030\004 \001(\t\"x\n" + + "\023ListClustersRequest\022:\n\006parent\030\001 \001(\tB*\342A" + + "\001\002\372A#\n!locations.googleapis.com/Location" + + "\022\021\n\tpage_size\030\002 \001(\005\022\022\n\npage_token\030\003 \001(\t\"" + + "~\n\024ListClustersResponse\0228\n\010clusters\030\001 \003(" + + "\0132&.google.cloud.redis.cluster.v1.Cluste" + + "r\022\027\n\017next_page_token\030\002 \001(\t\022\023\n\013unreachabl" + + "e\030\003 \003(\t\"\240\001\n\024UpdateClusterRequest\0225\n\013upda" + + "te_mask\030\001 \001(\0132\032.google.protobuf.FieldMas" + + "kB\004\342A\001\002\022=\n\007cluster\030\002 \001(\0132&.google.cloud." + + "redis.cluster.v1.ClusterB\004\342A\001\002\022\022\n\nreques" + + "t_id\030\003 \001(\t\"H\n\021GetClusterRequest\0223\n\004name\030" + + "\001 \001(\tB%\342A\001\002\372A\036\n\034redis.googleapis.com/Clu" + + "ster\"_\n\024DeleteClusterRequest\0223\n\004name\030\001 \001" + + "(\tB%\342A\001\002\372A\036\n\034redis.googleapis.com/Cluste" + + "r\022\022\n\nrequest_id\030\002 \001(\t\"\274\t\n\007Cluster\022\022\n\004nam" + + "e\030\001 \001(\tB\004\342A\001\002\0225\n\013create_time\030\003 \001(\0132\032.goo" + + "gle.protobuf.TimestampB\004\342A\001\003\022A\n\005state\030\004 " + + "\001(\0162,.google.cloud.redis.cluster.v1.Clus" + + "ter.StateB\004\342A\001\003\022\021\n\003uid\030\005 \001(\tB\004\342A\001\003\022 \n\rre" + + "plica_count\030\010 \001(\005B\004\342A\001\001H\000\210\001\001\022R\n\022authoriz" + + "ation_mode\030\013 \001(\01620.google.cloud.redis.cl" + + "uster.v1.AuthorizationModeB\004\342A\001\001\022[\n\027tran" + + "sit_encryption_mode\030\014 \001(\01624.google.cloud" + + ".redis.cluster.v1.TransitEncryptionModeB" + + "\004\342A\001\001\022\032\n\007size_gb\030\r \001(\005B\004\342A\001\003H\001\210\001\001\022\036\n\013sha" + + "rd_count\030\016 \001(\005B\004\342A\001\002H\002\210\001\001\022C\n\013psc_configs" + + "\030\017 \003(\0132(.google.cloud.redis.cluster.v1.P" + + "scConfigB\004\342A\001\002\022S\n\023discovery_endpoints\030\020 " + + "\003(\01320.google.cloud.redis.cluster.v1.Disc" + + "overyEndpointB\004\342A\001\003\022K\n\017psc_connections\030\021" + + " \003(\0132,.google.cloud.redis.cluster.v1.Psc" + + "ConnectionB\004\342A\001\003\022J\n\nstate_info\030\022 \001(\01320.g" + + "oogle.cloud.redis.cluster.v1.Cluster.Sta" + + "teInfoB\004\342A\001\003\032\352\001\n\tStateInfo\022R\n\013update_inf" + + "o\030\001 \001(\0132;.google.cloud.redis.cluster.v1." + + "Cluster.StateInfo.UpdateInfoH\000\032\200\001\n\nUpdat" + + "eInfo\022\037\n\022target_shard_count\030\001 \001(\005H\000\210\001\001\022!" + + "\n\024target_replica_count\030\002 \001(\005H\001\210\001\001B\025\n\023_ta" + + "rget_shard_countB\027\n\025_target_replica_coun" + + "tB\006\n\004info\"T\n\005State\022\025\n\021STATE_UNSPECIFIED\020" + + "\000\022\014\n\010CREATING\020\001\022\n\n\006ACTIVE\020\002\022\014\n\010UPDATING\020" + + "\003\022\014\n\010DELETING\020\004:]\352AZ\n\034redis.googleapis.c" + + "om/Cluster\022:projects/{project}/locations" + + "/{location}/clusters/{cluster}B\020\n\016_repli" + + "ca_countB\n\n\010_size_gbB\016\n\014_shard_count\"\"\n\t" + + "PscConfig\022\025\n\007network\030\002 \001(\tB\004\342A\001\002\"\202\001\n\021Dis" + + "coveryEndpoint\022\025\n\007address\030\001 \001(\tB\004\342A\001\003\022\022\n" + + "\004port\030\002 \001(\005B\004\342A\001\003\022B\n\npsc_config\030\003 \001(\0132(." + + "google.cloud.redis.cluster.v1.PscConfigB" + + "\004\342A\001\003\"\221\001\n\rPscConnection\022\037\n\021psc_connectio" + + "n_id\030\001 \001(\tB\004\342A\001\003\022\025\n\007address\030\002 \001(\tB\004\342A\001\003\022" + + "\035\n\017forwarding_rule\030\003 \001(\tB\004\342A\001\003\022\030\n\nprojec" + + "t_id\030\004 \001(\tB\004\342A\001\003\022\017\n\007network\030\005 \001(\t\"\207\002\n\021Op" + + "erationMetadata\0225\n\013create_time\030\001 \001(\0132\032.g" + + "oogle.protobuf.TimestampB\004\342A\001\003\0222\n\010end_ti" + + "me\030\002 \001(\0132\032.google.protobuf.TimestampB\004\342A" + + "\001\003\022\024\n\006target\030\003 \001(\tB\004\342A\001\003\022\022\n\004verb\030\004 \001(\tB\004" + + "\342A\001\003\022\034\n\016status_message\030\005 \001(\tB\004\342A\001\003\022$\n\026re" + + "quested_cancellation\030\006 \001(\010B\004\342A\001\003\022\031\n\013api_" + + "version\030\007 \001(\tB\004\342A\001\003*^\n\021AuthorizationMode" + + "\022\031\n\025AUTH_MODE_UNSPECIFIED\020\000\022\026\n\022AUTH_MODE" + + "_IAM_AUTH\020\001\022\026\n\022AUTH_MODE_DISABLED\020\002*\231\001\n\025" + + "TransitEncryptionMode\022\'\n#TRANSIT_ENCRYPT" + + "ION_MODE_UNSPECIFIED\020\000\022$\n TRANSIT_ENCRYP" + + "TION_MODE_DISABLED\020\001\0221\n-TRANSIT_ENCRYPTI" + + "ON_MODE_SERVER_AUTHENTICATION\020\0022\324\010\n\021Clou" + + "dRedisCluster\022\266\001\n\014ListClusters\0222.google." + + "cloud.redis.cluster.v1.ListClustersReque" + + "st\0323.google.cloud.redis.cluster.v1.ListC" + + "lustersResponse\"=\332A\006parent\202\323\344\223\002.\022,/v1/{p" + + "arent=projects/*/locations/*}/clusters\022\243" + + "\001\n\nGetCluster\0220.google.cloud.redis.clust" + + "er.v1.GetClusterRequest\032&.google.cloud.r" + + "edis.cluster.v1.Cluster\";\332A\004name\202\323\344\223\002.\022," + + "/v1/{name=projects/*/locations/*/cluster" + + "s/*}\022\341\001\n\rUpdateCluster\0223.google.cloud.re" + + "dis.cluster.v1.UpdateClusterRequest\032\035.go" + + "ogle.longrunning.Operation\"|\312A\036\n\007Cluster" + + "\022\023google.protobuf.Any\332A\023cluster,update_m" + + "ask\202\323\344\223\002?24/v1/{cluster.name=projects/*/" + + "locations/*/clusters/*}:\007cluster\022\317\001\n\rDel" + + "eteCluster\0223.google.cloud.redis.cluster." + + "v1.DeleteClusterRequest\032\035.google.longrun" + + "ning.Operation\"j\312A,\n\025google.protobuf.Emp" + + "ty\022\023google.protobuf.Any\332A\004name\202\323\344\223\002.*,/v" + + "1/{name=projects/*/locations/*/clusters/" + + "*}\022\337\001\n\rCreateCluster\0223.google.cloud.redi" + + "s.cluster.v1.CreateClusterRequest\032\035.goog" + + "le.longrunning.Operation\"z\312A\036\n\007Cluster\022\023" + + "google.protobuf.Any\332A\031parent,cluster,clu" + + "ster_id\202\323\344\223\0027\",/v1/{parent=projects/*/lo" + + "cations/*}/clusters:\007cluster\032H\312A\024redis.g" + + "oogleapis.com\322A.https://www.googleapis.c" + + "om/auth/cloud-platformBz\n!com.google.clo" + + "ud.redis.cluster.v1B\026CloudRedisClusterPr" + + "otoP\001Z;cloud.google.com/go/redis/cluster" + + "/apiv1/clusterpb;clusterpbb\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.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_descriptor, + new java.lang.String[] { + "Parent", "ClusterId", "Cluster", "RequestId", + }); + internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", + }); + internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_descriptor, + new java.lang.String[] { + "Clusters", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Cluster", "RequestId", + }); + internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", + }); + internal_static_google_cloud_redis_cluster_v1_Cluster_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_redis_cluster_v1_Cluster_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_Cluster_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "State", + "Uid", + "ReplicaCount", + "AuthorizationMode", + "TransitEncryptionMode", + "SizeGb", + "ShardCount", + "PscConfigs", + "DiscoveryEndpoints", + "PscConnections", + "StateInfo", + "ReplicaCount", + "SizeGb", + "ShardCount", + }); + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_descriptor = + internal_static_google_cloud_redis_cluster_v1_Cluster_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_descriptor, + new java.lang.String[] { + "UpdateInfo", "Info", + }); + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_descriptor = + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_descriptor, + new java.lang.String[] { + "TargetShardCount", "TargetReplicaCount", "TargetShardCount", "TargetReplicaCount", + }); + internal_static_google_cloud_redis_cluster_v1_PscConfig_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_redis_cluster_v1_PscConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_PscConfig_descriptor, + new java.lang.String[] { + "Network", + }); + internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_descriptor, + new java.lang.String[] { + "Address", "Port", "PscConfig", + }); + internal_static_google_cloud_redis_cluster_v1_PscConnection_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_redis_cluster_v1_PscConnection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_PscConnection_descriptor, + new java.lang.String[] { + "PscConnectionId", "Address", "ForwardingRule", "ProjectId", "Network", + }); + internal_static_google_cloud_redis_cluster_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_redis_cluster_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_redis_cluster_v1_OperationMetadata_descriptor, + new java.lang.String[] { + "CreateTime", + "EndTime", + "Target", + "Verb", + "StatusMessage", + "RequestedCancellation", + "ApiVersion", + }); + 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.resource); + 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.longrunning.OperationsProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.FieldMaskProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/Cluster.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/Cluster.java new file mode 100644 index 000000000000..c1da78e30467 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/Cluster.java @@ -0,0 +1,5853 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * A cluster instance.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.Cluster} + */ +public final class Cluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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_ = ""; + state_ = 0; + uid_ = ""; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + pscConfigs_ = java.util.Collections.emptyList(); + discoveryEndpoints_ = java.util.Collections.emptyList(); + pscConnections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Cluster(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.Cluster.class, + com.google.cloud.redis.cluster.v1.Cluster.Builder.class); + } + + /** + * + * + *
+   * Represents the different states of a Redis cluster.
+   * 
+ * + * Protobuf enum {@code google.cloud.redis.cluster.v1.Cluster.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Redis cluster is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Redis cluster has been created and is fully usable.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + /** + * + * + *
+     * Redis cluster configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+     * Redis cluster is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Redis cluster is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Redis cluster has been created and is fully usable.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + /** + * + * + *
+     * Redis cluster configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + * + * + *
+     * Redis cluster 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 CREATING; + case 2: + return ACTIVE; + case 3: + return UPDATING; + 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.redis.cluster.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.redis.cluster.v1.Cluster.State) + } + + public interface StateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.Cluster.StateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * @return Whether the updateInfo field is set. + */ + boolean hasUpdateInfo(); + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * @return The updateInfo. + */ + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo getUpdateInfo(); + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder(); + + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.InfoCase getInfoCase(); + } + /** + * + * + *
+   * Represents additional information about the state of the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.Cluster.StateInfo} + */ + public static final class StateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1.Cluster.StateInfo) + StateInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateInfo.newBuilder() to construct. + private StateInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StateInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StateInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.class, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.Builder.class); + } + + public interface UpdateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return Whether the targetShardCount field is set. + */ + boolean hasTargetShardCount(); + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return The targetShardCount. + */ + int getTargetShardCount(); + + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return Whether the targetReplicaCount field is set. + */ + boolean hasTargetReplicaCount(); + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return The targetReplicaCount. + */ + int getTargetReplicaCount(); + } + /** + * + * + *
+     * Represents information about an updating cluster.
+     * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo} + */ + public static final class UpdateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) + UpdateInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInfo.newBuilder() to construct. + private UpdateInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.class, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.Builder.class); + } + + private int bitField0_; + public static final int TARGET_SHARD_COUNT_FIELD_NUMBER = 1; + private int targetShardCount_ = 0; + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return The targetShardCount. + */ + @java.lang.Override + public int getTargetShardCount() { + return targetShardCount_; + } + + public static final int TARGET_REPLICA_COUNT_FIELD_NUMBER = 2; + private int targetReplicaCount_ = 0; + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return The targetReplicaCount. + */ + @java.lang.Override + public int getTargetReplicaCount() { + return targetReplicaCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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.writeInt32(1, targetShardCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, targetReplicaCount_); + } + 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.computeInt32Size(1, targetShardCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, targetReplicaCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo other = + (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) obj; + + if (hasTargetShardCount() != other.hasTargetShardCount()) return false; + if (hasTargetShardCount()) { + if (getTargetShardCount() != other.getTargetShardCount()) return false; + } + if (hasTargetReplicaCount() != other.hasTargetReplicaCount()) return false; + if (hasTargetReplicaCount()) { + if (getTargetReplicaCount() != other.getTargetReplicaCount()) 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 (hasTargetShardCount()) { + hash = (37 * hash) + TARGET_SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTargetShardCount(); + } + if (hasTargetReplicaCount()) { + hash = (37 * hash) + TARGET_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTargetReplicaCount(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 information about an updating cluster.
+       * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.class, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.Builder.class); + } + + // Construct using + // com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetShardCount_ = 0; + targetReplicaCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo build() { + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo buildPartial() { + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo result = + new com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.targetShardCount_ = targetShardCount_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.targetReplicaCount_ = targetReplicaCount_; + to_bitField0_ |= 0x00000002; + } + 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.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) { + return mergeFrom( + (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo other) { + if (other + == com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance()) return this; + if (other.hasTargetShardCount()) { + setTargetShardCount(other.getTargetShardCount()); + } + if (other.hasTargetReplicaCount()) { + setTargetReplicaCount(other.getTargetReplicaCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + targetShardCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + targetReplicaCount_ = input.readInt32(); + 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 targetShardCount_; + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @return The targetShardCount. + */ + @java.lang.Override + public int getTargetShardCount() { + return targetShardCount_; + } + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @param value The targetShardCount to set. + * @return This builder for chaining. + */ + public Builder setTargetShardCount(int value) { + + targetShardCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearTargetShardCount() { + bitField0_ = (bitField0_ & ~0x00000001); + targetShardCount_ = 0; + onChanged(); + return this; + } + + private int targetReplicaCount_; + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @return The targetReplicaCount. + */ + @java.lang.Override + public int getTargetReplicaCount() { + return targetReplicaCount_; + } + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @param value The targetReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setTargetReplicaCount(int value) { + + targetReplicaCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearTargetReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000002); + targetReplicaCount_ = 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.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) + private static final com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo(); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int infoCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object info_; + + public enum InfoCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + UPDATE_INFO(1), + INFO_NOT_SET(0); + private final int value; + + private InfoCase(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 InfoCase valueOf(int value) { + return forNumber(value); + } + + public static InfoCase forNumber(int value) { + switch (value) { + case 1: + return UPDATE_INFO; + case 0: + return INFO_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public InfoCase getInfoCase() { + return InfoCase.forNumber(infoCase_); + } + + public static final int UPDATE_INFO_FIELD_NUMBER = 1; + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo getUpdateInfo() { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.getDefaultInstance(); + } + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (infoCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (infoCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.Cluster.StateInfo)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.Cluster.StateInfo other = + (com.google.cloud.redis.cluster.v1.Cluster.StateInfo) obj; + + if (!getInfoCase().equals(other.getInfoCase())) return false; + switch (infoCase_) { + case 1: + if (!getUpdateInfo().equals(other.getUpdateInfo())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (infoCase_) { + case 1: + hash = (37 * hash) + UPDATE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUpdateInfo().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 additional information about the state of the cluster.
+     * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.Cluster.StateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.Cluster.StateInfo) + com.google.cloud.redis.cluster.v1.Cluster.StateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.class, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1.Cluster.StateInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (updateInfoBuilder_ != null) { + updateInfoBuilder_.clear(); + } + infoCase_ = 0; + info_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_StateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.Cluster.StateInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo build() { + com.google.cloud.redis.cluster.v1.Cluster.StateInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo buildPartial() { + com.google.cloud.redis.cluster.v1.Cluster.StateInfo result = + new com.google.cloud.redis.cluster.v1.Cluster.StateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.Cluster.StateInfo result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.redis.cluster.v1.Cluster.StateInfo result) { + result.infoCase_ = infoCase_; + result.info_ = this.info_; + if (infoCase_ == 1 && updateInfoBuilder_ != null) { + result.info_ = updateInfoBuilder_.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.redis.cluster.v1.Cluster.StateInfo) { + return mergeFrom((com.google.cloud.redis.cluster.v1.Cluster.StateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.Cluster.StateInfo other) { + if (other == com.google.cloud.redis.cluster.v1.Cluster.StateInfo.getDefaultInstance()) + return this; + switch (other.getInfoCase()) { + case UPDATE_INFO: + { + mergeUpdateInfo(other.getUpdateInfo()); + break; + } + case INFO_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(getUpdateInfoFieldBuilder().getBuilder(), extensionRegistry); + infoCase_ = 1; + 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 infoCase_ = 0; + private java.lang.Object info_; + + public InfoCase getInfoCase() { + return InfoCase.forNumber(infoCase_); + } + + public Builder clearInfo() { + infoCase_ = 0; + info_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.Builder, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoOrBuilder> + updateInfoBuilder_; + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo getUpdateInfo() { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } else { + if (infoCase_ == 1) { + return updateInfoBuilder_.getMessage(); + } + return com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + public Builder setUpdateInfo( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + onChanged(); + } else { + updateInfoBuilder_.setMessage(value); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + public Builder setUpdateInfo( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.Builder builderForValue) { + if (updateInfoBuilder_ == null) { + info_ = builderForValue.build(); + onChanged(); + } else { + updateInfoBuilder_.setMessage(builderForValue.build()); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + public Builder mergeUpdateInfo( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1 + && info_ + != com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance()) { + info_ = + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.newBuilder( + (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_) + .mergeFrom(value) + .buildPartial(); + } else { + info_ = value; + } + onChanged(); + } else { + if (infoCase_ == 1) { + updateInfoBuilder_.mergeFrom(value); + } else { + updateInfoBuilder_.setMessage(value); + } + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + public Builder clearUpdateInfo() { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1) { + infoCase_ = 0; + info_ = null; + onChanged(); + } + } else { + if (infoCase_ == 1) { + infoCase_ = 0; + info_ = null; + } + updateInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.Builder + getUpdateInfoBuilder() { + return getUpdateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if ((infoCase_ == 1) && (updateInfoBuilder_ != null)) { + return updateInfoBuilder_.getMessageOrBuilder(); + } else { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo update_info = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.Builder, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoOrBuilder> + getUpdateInfoFieldBuilder() { + if (updateInfoBuilder_ == null) { + if (!(infoCase_ == 1)) { + info_ = + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.getDefaultInstance(); + } + updateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo.Builder, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfoOrBuilder>( + (com.google.cloud.redis.cluster.v1.Cluster.StateInfo.UpdateInfo) info_, + getParentForChildren(), + isClean()); + info_ = null; + } + infoCase_ = 1; + onChanged(); + return updateInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1.Cluster.StateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.Cluster.StateInfo) + private static final com.google.cloud.redis.cluster.v1.Cluster.StateInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.Cluster.StateInfo(); + } + + public static com.google.cloud.redis.cluster.v1.Cluster.StateInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 STATE_FIELD_NUMBER = 4; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.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 this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.State getState() { + com.google.cloud.redis.cluster.v1.Cluster.State result = + com.google.cloud.redis.cluster.v1.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.redis.cluster.v1.Cluster.State.UNRECOGNIZED : result; + } + + public static final int UID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.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. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.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 REPLICA_COUNT_FIELD_NUMBER = 8; + private int replicaCount_ = 0; + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + @java.lang.Override + public boolean hasReplicaCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + @java.lang.Override + public int getReplicaCount() { + return replicaCount_; + } + + public static final int AUTHORIZATION_MODE_FIELD_NUMBER = 11; + private int authorizationMode_ = 0; + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.AuthorizationMode getAuthorizationMode() { + com.google.cloud.redis.cluster.v1.AuthorizationMode result = + com.google.cloud.redis.cluster.v1.AuthorizationMode.forNumber(authorizationMode_); + return result == null + ? com.google.cloud.redis.cluster.v1.AuthorizationMode.UNRECOGNIZED + : result; + } + + public static final int TRANSIT_ENCRYPTION_MODE_FIELD_NUMBER = 12; + private int transitEncryptionMode_ = 0; + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.TransitEncryptionMode getTransitEncryptionMode() { + com.google.cloud.redis.cluster.v1.TransitEncryptionMode result = + com.google.cloud.redis.cluster.v1.TransitEncryptionMode.forNumber(transitEncryptionMode_); + return result == null + ? com.google.cloud.redis.cluster.v1.TransitEncryptionMode.UNRECOGNIZED + : result; + } + + public static final int SIZE_GB_FIELD_NUMBER = 13; + private int sizeGb_ = 0; + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the sizeGb field is set. + */ + @java.lang.Override + public boolean hasSizeGb() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public int getSizeGb() { + return sizeGb_; + } + + public static final int SHARD_COUNT_FIELD_NUMBER = 14; + private int shardCount_ = 0; + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the shardCount field is set. + */ + @java.lang.Override + public boolean hasShardCount() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + + public static final int PSC_CONFIGS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private java.util.List pscConfigs_; + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPscConfigsList() { + return pscConfigs_; + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPscConfigsOrBuilderList() { + return pscConfigs_; + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPscConfigsCount() { + return pscConfigs_.size(); + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfig getPscConfigs(int index) { + return pscConfigs_.get(index); + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfigOrBuilder getPscConfigsOrBuilder(int index) { + return pscConfigs_.get(index); + } + + public static final int DISCOVERY_ENDPOINTS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private java.util.List discoveryEndpoints_; + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsOrBuilderList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDiscoveryEndpointsCount() { + return discoveryEndpoints_.size(); + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint getDiscoveryEndpoints(int index) { + return discoveryEndpoints_.get(index); + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DiscoveryEndpointOrBuilder + getDiscoveryEndpointsOrBuilder(int index) { + return discoveryEndpoints_.get(index); + } + + public static final int PSC_CONNECTIONS_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private java.util.List pscConnections_; + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List getPscConnectionsList() { + return pscConnections_; + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPscConnectionsOrBuilderList() { + return pscConnections_; + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPscConnectionsCount() { + return pscConnections_.size(); + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConnection getPscConnections(int index) { + return pscConnections_.get(index); + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConnectionOrBuilder getPscConnectionsOrBuilder( + int index) { + return pscConnections_.get(index); + } + + public static final int STATE_INFO_FIELD_NUMBER = 18; + private com.google.cloud.redis.cluster.v1.Cluster.StateInfo stateInfo_; + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + @java.lang.Override + public boolean hasStateInfo() { + return stateInfo_ != null; + } + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo getStateInfo() { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.StateInfoOrBuilder getStateInfoOrBuilder() { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (state_ != com.google.cloud.redis.cluster.v1.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, uid_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.redis.cluster.v1.AuthorizationMode.AUTH_MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(11, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.redis.cluster.v1.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(12, transitEncryptionMode_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(13, sizeGb_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(14, shardCount_); + } + for (int i = 0; i < pscConfigs_.size(); i++) { + output.writeMessage(15, pscConfigs_.get(i)); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + output.writeMessage(16, discoveryEndpoints_.get(i)); + } + for (int i = 0; i < pscConnections_.size(); i++) { + output.writeMessage(17, pscConnections_.get(i)); + } + if (stateInfo_ != null) { + output.writeMessage(18, getStateInfo()); + } + 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (state_ != com.google.cloud.redis.cluster.v1.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, uid_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.redis.cluster.v1.AuthorizationMode.AUTH_MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.redis.cluster.v1.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, transitEncryptionMode_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(13, sizeGb_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(14, shardCount_); + } + for (int i = 0; i < pscConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, pscConfigs_.get(i)); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(16, discoveryEndpoints_.get(i)); + } + for (int i = 0; i < pscConnections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, pscConnections_.get(i)); + } + if (stateInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getStateInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.Cluster)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.Cluster other = + (com.google.cloud.redis.cluster.v1.Cluster) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (state_ != other.state_) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasReplicaCount() != other.hasReplicaCount()) return false; + if (hasReplicaCount()) { + if (getReplicaCount() != other.getReplicaCount()) return false; + } + if (authorizationMode_ != other.authorizationMode_) return false; + if (transitEncryptionMode_ != other.transitEncryptionMode_) return false; + if (hasSizeGb() != other.hasSizeGb()) return false; + if (hasSizeGb()) { + if (getSizeGb() != other.getSizeGb()) return false; + } + if (hasShardCount() != other.hasShardCount()) return false; + if (hasShardCount()) { + if (getShardCount() != other.getShardCount()) return false; + } + if (!getPscConfigsList().equals(other.getPscConfigsList())) return false; + if (!getDiscoveryEndpointsList().equals(other.getDiscoveryEndpointsList())) return false; + if (!getPscConnectionsList().equals(other.getPscConnectionsList())) return false; + if (hasStateInfo() != other.hasStateInfo()) return false; + if (hasStateInfo()) { + if (!getStateInfo().equals(other.getStateInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasReplicaCount()) { + hash = (37 * hash) + REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getReplicaCount(); + } + hash = (37 * hash) + AUTHORIZATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + authorizationMode_; + hash = (37 * hash) + TRANSIT_ENCRYPTION_MODE_FIELD_NUMBER; + hash = (53 * hash) + transitEncryptionMode_; + if (hasSizeGb()) { + hash = (37 * hash) + SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getSizeGb(); + } + if (hasShardCount()) { + hash = (37 * hash) + SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getShardCount(); + } + if (getPscConfigsCount() > 0) { + hash = (37 * hash) + PSC_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getPscConfigsList().hashCode(); + } + if (getDiscoveryEndpointsCount() > 0) { + hash = (37 * hash) + DISCOVERY_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getDiscoveryEndpointsList().hashCode(); + } + if (getPscConnectionsCount() > 0) { + hash = (37 * hash) + PSC_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscConnectionsList().hashCode(); + } + if (hasStateInfo()) { + hash = (37 * hash) + STATE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getStateInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.Cluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.Cluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.Cluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.Cluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.Cluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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 instance.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.Cluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.Cluster) + com.google.cloud.redis.cluster.v1.ClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.Cluster.class, + com.google.cloud.redis.cluster.v1.Cluster.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + state_ = 0; + uid_ = ""; + replicaCount_ = 0; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + sizeGb_ = 0; + shardCount_ = 0; + if (pscConfigsBuilder_ == null) { + pscConfigs_ = java.util.Collections.emptyList(); + } else { + pscConfigs_ = null; + pscConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + } else { + discoveryEndpoints_ = null; + discoveryEndpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + if (pscConnectionsBuilder_ == null) { + pscConnections_ = java.util.Collections.emptyList(); + } else { + pscConnections_ = null; + pscConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_Cluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster build() { + com.google.cloud.redis.cluster.v1.Cluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster buildPartial() { + com.google.cloud.redis.cluster.v1.Cluster result = + new com.google.cloud.redis.cluster.v1.Cluster(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.redis.cluster.v1.Cluster result) { + if (pscConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + pscConfigs_ = java.util.Collections.unmodifiableList(pscConfigs_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.pscConfigs_ = pscConfigs_; + } else { + result.pscConfigs_ = pscConfigsBuilder_.build(); + } + if (discoveryEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + discoveryEndpoints_ = java.util.Collections.unmodifiableList(discoveryEndpoints_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.discoveryEndpoints_ = discoveryEndpoints_; + } else { + result.discoveryEndpoints_ = discoveryEndpointsBuilder_.build(); + } + if (pscConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + pscConnections_ = java.util.Collections.unmodifiableList(pscConnections_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.pscConnections_ = pscConnections_; + } else { + result.pscConnections_ = pscConnectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.Cluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.uid_ = uid_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.replicaCount_ = replicaCount_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.authorizationMode_ = authorizationMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.transitEncryptionMode_ = transitEncryptionMode_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.sizeGb_ = sizeGb_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.shardCount_ = shardCount_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.stateInfo_ = stateInfoBuilder_ == null ? stateInfo_ : stateInfoBuilder_.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.redis.cluster.v1.Cluster) { + return mergeFrom((com.google.cloud.redis.cluster.v1.Cluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.Cluster other) { + if (other == com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasReplicaCount()) { + setReplicaCount(other.getReplicaCount()); + } + if (other.authorizationMode_ != 0) { + setAuthorizationModeValue(other.getAuthorizationModeValue()); + } + if (other.transitEncryptionMode_ != 0) { + setTransitEncryptionModeValue(other.getTransitEncryptionModeValue()); + } + if (other.hasSizeGb()) { + setSizeGb(other.getSizeGb()); + } + if (other.hasShardCount()) { + setShardCount(other.getShardCount()); + } + if (pscConfigsBuilder_ == null) { + if (!other.pscConfigs_.isEmpty()) { + if (pscConfigs_.isEmpty()) { + pscConfigs_ = other.pscConfigs_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensurePscConfigsIsMutable(); + pscConfigs_.addAll(other.pscConfigs_); + } + onChanged(); + } + } else { + if (!other.pscConfigs_.isEmpty()) { + if (pscConfigsBuilder_.isEmpty()) { + pscConfigsBuilder_.dispose(); + pscConfigsBuilder_ = null; + pscConfigs_ = other.pscConfigs_; + bitField0_ = (bitField0_ & ~0x00000200); + pscConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPscConfigsFieldBuilder() + : null; + } else { + pscConfigsBuilder_.addAllMessages(other.pscConfigs_); + } + } + } + if (discoveryEndpointsBuilder_ == null) { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpoints_.isEmpty()) { + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.addAll(other.discoveryEndpoints_); + } + onChanged(); + } + } else { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpointsBuilder_.isEmpty()) { + discoveryEndpointsBuilder_.dispose(); + discoveryEndpointsBuilder_ = null; + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000400); + discoveryEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDiscoveryEndpointsFieldBuilder() + : null; + } else { + discoveryEndpointsBuilder_.addAllMessages(other.discoveryEndpoints_); + } + } + } + if (pscConnectionsBuilder_ == null) { + if (!other.pscConnections_.isEmpty()) { + if (pscConnections_.isEmpty()) { + pscConnections_ = other.pscConnections_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensurePscConnectionsIsMutable(); + pscConnections_.addAll(other.pscConnections_); + } + onChanged(); + } + } else { + if (!other.pscConnections_.isEmpty()) { + if (pscConnectionsBuilder_.isEmpty()) { + pscConnectionsBuilder_.dispose(); + pscConnectionsBuilder_ = null; + pscConnections_ = other.pscConnections_; + bitField0_ = (bitField0_ & ~0x00000800); + pscConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPscConnectionsFieldBuilder() + : null; + } else { + pscConnectionsBuilder_.addAllMessages(other.pscConnections_); + } + } + } + if (other.hasStateInfo()) { + mergeStateInfo(other.getStateInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 64: + { + replicaCount_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 64 + case 88: + { + authorizationMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 88 + case 96: + { + transitEncryptionMode_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 96 + case 104: + { + sizeGb_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 104 + case 112: + { + shardCount_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 112 + case 122: + { + com.google.cloud.redis.cluster.v1.PscConfig m = + input.readMessage( + com.google.cloud.redis.cluster.v1.PscConfig.parser(), extensionRegistry); + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.add(m); + } else { + pscConfigsBuilder_.addMessage(m); + } + break; + } // case 122 + case 130: + { + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint m = + input.readMessage( + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.parser(), + extensionRegistry); + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(m); + } else { + discoveryEndpointsBuilder_.addMessage(m); + } + break; + } // case 130 + case 138: + { + com.google.cloud.redis.cluster.v1.PscConnection m = + input.readMessage( + com.google.cloud.redis.cluster.v1.PscConnection.parser(), + extensionRegistry); + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.add(m); + } else { + pscConnectionsBuilder_.addMessage(m); + } + break; + } // case 138 + case 146: + { + input.readMessage(getStateInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 146 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + 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. The timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.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 this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster.State getState() { + com.google.cloud.redis.cluster.v1.Cluster.State result = + com.google.cloud.redis.cluster.v1.Cluster.State.forNumber(state_); + return result == null ? com.google.cloud.redis.cluster.v1.Cluster.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.redis.cluster.v1.Cluster.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + private int replicaCount_; + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + @java.lang.Override + public boolean hasReplicaCount() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + @java.lang.Override + public int getReplicaCount() { + return replicaCount_; + } + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The replicaCount to set. + * @return This builder for chaining. + */ + public Builder setReplicaCount(int value) { + + replicaCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000010); + replicaCount_ = 0; + onChanged(); + return this; + } + + private int authorizationMode_ = 0; + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for authorizationMode to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationModeValue(int value) { + authorizationMode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.AuthorizationMode getAuthorizationMode() { + com.google.cloud.redis.cluster.v1.AuthorizationMode result = + com.google.cloud.redis.cluster.v1.AuthorizationMode.forNumber(authorizationMode_); + return result == null + ? com.google.cloud.redis.cluster.v1.AuthorizationMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The authorizationMode to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationMode(com.google.cloud.redis.cluster.v1.AuthorizationMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + authorizationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizationMode() { + bitField0_ = (bitField0_ & ~0x00000020); + authorizationMode_ = 0; + onChanged(); + return this; + } + + private int transitEncryptionMode_ = 0; + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for transitEncryptionMode to set. + * @return This builder for chaining. + */ + public Builder setTransitEncryptionModeValue(int value) { + transitEncryptionMode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.TransitEncryptionMode getTransitEncryptionMode() { + com.google.cloud.redis.cluster.v1.TransitEncryptionMode result = + com.google.cloud.redis.cluster.v1.TransitEncryptionMode.forNumber(transitEncryptionMode_); + return result == null + ? com.google.cloud.redis.cluster.v1.TransitEncryptionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transitEncryptionMode to set. + * @return This builder for chaining. + */ + public Builder setTransitEncryptionMode( + com.google.cloud.redis.cluster.v1.TransitEncryptionMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + transitEncryptionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransitEncryptionMode() { + bitField0_ = (bitField0_ & ~0x00000040); + transitEncryptionMode_ = 0; + onChanged(); + return this; + } + + private int sizeGb_; + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the sizeGb field is set. + */ + @java.lang.Override + public boolean hasSizeGb() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public int getSizeGb() { + return sizeGb_; + } + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeGb to set. + * @return This builder for chaining. + */ + public Builder setSizeGb(int value) { + + sizeGb_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeGb() { + bitField0_ = (bitField0_ & ~0x00000080); + sizeGb_ = 0; + onChanged(); + return this; + } + + private int shardCount_; + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the shardCount field is set. + */ + @java.lang.Override + public boolean hasShardCount() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The shardCount to set. + * @return This builder for chaining. + */ + public Builder setShardCount(int value) { + + shardCount_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearShardCount() { + bitField0_ = (bitField0_ & ~0x00000100); + shardCount_ = 0; + onChanged(); + return this; + } + + private java.util.List pscConfigs_ = + java.util.Collections.emptyList(); + + private void ensurePscConfigsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + pscConfigs_ = + new java.util.ArrayList(pscConfigs_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConfig, + com.google.cloud.redis.cluster.v1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder> + pscConfigsBuilder_; + + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPscConfigsList() { + if (pscConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscConfigs_); + } else { + return pscConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPscConfigsCount() { + if (pscConfigsBuilder_ == null) { + return pscConfigs_.size(); + } else { + return pscConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConfig getPscConfigs(int index) { + if (pscConfigsBuilder_ == null) { + return pscConfigs_.get(index); + } else { + return pscConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPscConfigs(int index, com.google.cloud.redis.cluster.v1.PscConfig value) { + if (pscConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConfigsIsMutable(); + pscConfigs_.set(index, value); + onChanged(); + } else { + pscConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPscConfigs( + int index, com.google.cloud.redis.cluster.v1.PscConfig.Builder builderForValue) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + pscConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs(com.google.cloud.redis.cluster.v1.PscConfig value) { + if (pscConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConfigsIsMutable(); + pscConfigs_.add(value); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs(int index, com.google.cloud.redis.cluster.v1.PscConfig value) { + if (pscConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConfigsIsMutable(); + pscConfigs_.add(index, value); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs( + com.google.cloud.redis.cluster.v1.PscConfig.Builder builderForValue) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.add(builderForValue.build()); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs( + int index, com.google.cloud.redis.cluster.v1.PscConfig.Builder builderForValue) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPscConfigs( + java.lang.Iterable values) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pscConfigs_); + onChanged(); + } else { + pscConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPscConfigs() { + if (pscConfigsBuilder_ == null) { + pscConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + pscConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePscConfigs(int index) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.remove(index); + onChanged(); + } else { + pscConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConfig.Builder getPscConfigsBuilder(int index) { + return getPscConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConfigOrBuilder getPscConfigsOrBuilder(int index) { + if (pscConfigsBuilder_ == null) { + return pscConfigs_.get(index); + } else { + return pscConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPscConfigsOrBuilderList() { + if (pscConfigsBuilder_ != null) { + return pscConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscConfigs_); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConfig.Builder addPscConfigsBuilder() { + return getPscConfigsFieldBuilder() + .addBuilder(com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConfig.Builder addPscConfigsBuilder(int index) { + return getPscConfigsFieldBuilder() + .addBuilder(index, com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPscConfigsBuilderList() { + return getPscConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConfig, + com.google.cloud.redis.cluster.v1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder> + getPscConfigsFieldBuilder() { + if (pscConfigsBuilder_ == null) { + pscConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConfig, + com.google.cloud.redis.cluster.v1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder>( + pscConfigs_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); + pscConfigs_ = null; + } + return pscConfigsBuilder_; + } + + private java.util.List + discoveryEndpoints_ = java.util.Collections.emptyList(); + + private void ensureDiscoveryEndpointsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + discoveryEndpoints_ = + new java.util.ArrayList( + discoveryEndpoints_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint, + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder, + com.google.cloud.redis.cluster.v1.DiscoveryEndpointOrBuilder> + discoveryEndpointsBuilder_; + + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDiscoveryEndpointsList() { + if (discoveryEndpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(discoveryEndpoints_); + } else { + return discoveryEndpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDiscoveryEndpointsCount() { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.size(); + } else { + return discoveryEndpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint getDiscoveryEndpoints(int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, com.google.cloud.redis.cluster.v1.DiscoveryEndpoint value) { + if (discoveryEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.set(index, value); + onChanged(); + } else { + discoveryEndpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint value) { + if (discoveryEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(value); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, com.google.cloud.redis.cluster.v1.DiscoveryEndpoint value) { + if (discoveryEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(index, value); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDiscoveryEndpoints( + java.lang.Iterable values) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, discoveryEndpoints_); + onChanged(); + } else { + discoveryEndpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDiscoveryEndpoints() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + discoveryEndpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDiscoveryEndpoints(int index) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.remove(index); + onChanged(); + } else { + discoveryEndpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder getDiscoveryEndpointsBuilder( + int index) { + return getDiscoveryEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.DiscoveryEndpointOrBuilder + getDiscoveryEndpointsOrBuilder(int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDiscoveryEndpointsOrBuilderList() { + if (discoveryEndpointsBuilder_ != null) { + return discoveryEndpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(discoveryEndpoints_); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder + addDiscoveryEndpointsBuilder() { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder(com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder addDiscoveryEndpointsBuilder( + int index) { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder( + index, com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDiscoveryEndpointsBuilderList() { + return getDiscoveryEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint, + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder, + com.google.cloud.redis.cluster.v1.DiscoveryEndpointOrBuilder> + getDiscoveryEndpointsFieldBuilder() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint, + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder, + com.google.cloud.redis.cluster.v1.DiscoveryEndpointOrBuilder>( + discoveryEndpoints_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + discoveryEndpoints_ = null; + } + return discoveryEndpointsBuilder_; + } + + private java.util.List pscConnections_ = + java.util.Collections.emptyList(); + + private void ensurePscConnectionsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + pscConnections_ = + new java.util.ArrayList( + pscConnections_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConnection, + com.google.cloud.redis.cluster.v1.PscConnection.Builder, + com.google.cloud.redis.cluster.v1.PscConnectionOrBuilder> + pscConnectionsBuilder_; + + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List getPscConnectionsList() { + if (pscConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscConnections_); + } else { + return pscConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPscConnectionsCount() { + if (pscConnectionsBuilder_ == null) { + return pscConnections_.size(); + } else { + return pscConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConnection getPscConnections(int index) { + if (pscConnectionsBuilder_ == null) { + return pscConnections_.get(index); + } else { + return pscConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConnections( + int index, com.google.cloud.redis.cluster.v1.PscConnection value) { + if (pscConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConnectionsIsMutable(); + pscConnections_.set(index, value); + onChanged(); + } else { + pscConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConnections( + int index, com.google.cloud.redis.cluster.v1.PscConnection.Builder builderForValue) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections(com.google.cloud.redis.cluster.v1.PscConnection value) { + if (pscConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConnectionsIsMutable(); + pscConnections_.add(value); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections( + int index, com.google.cloud.redis.cluster.v1.PscConnection value) { + if (pscConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConnectionsIsMutable(); + pscConnections_.add(index, value); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections( + com.google.cloud.redis.cluster.v1.PscConnection.Builder builderForValue) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections( + int index, com.google.cloud.redis.cluster.v1.PscConnection.Builder builderForValue) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllPscConnections( + java.lang.Iterable values) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pscConnections_); + onChanged(); + } else { + pscConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPscConnections() { + if (pscConnectionsBuilder_ == null) { + pscConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + pscConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePscConnections(int index) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.remove(index); + onChanged(); + } else { + pscConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConnection.Builder getPscConnectionsBuilder( + int index) { + return getPscConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConnectionOrBuilder getPscConnectionsOrBuilder( + int index) { + if (pscConnectionsBuilder_ == null) { + return pscConnections_.get(index); + } else { + return pscConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscConnectionsOrBuilderList() { + if (pscConnectionsBuilder_ != null) { + return pscConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscConnections_); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConnection.Builder addPscConnectionsBuilder() { + return getPscConnectionsFieldBuilder() + .addBuilder(com.google.cloud.redis.cluster.v1.PscConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConnection.Builder addPscConnectionsBuilder( + int index) { + return getPscConnectionsFieldBuilder() + .addBuilder(index, com.google.cloud.redis.cluster.v1.PscConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscConnectionsBuilderList() { + return getPscConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConnection, + com.google.cloud.redis.cluster.v1.PscConnection.Builder, + com.google.cloud.redis.cluster.v1.PscConnectionOrBuilder> + getPscConnectionsFieldBuilder() { + if (pscConnectionsBuilder_ == null) { + pscConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConnection, + com.google.cloud.redis.cluster.v1.PscConnection.Builder, + com.google.cloud.redis.cluster.v1.PscConnectionOrBuilder>( + pscConnections_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + pscConnections_ = null; + } + return pscConnectionsBuilder_; + } + + private com.google.cloud.redis.cluster.v1.Cluster.StateInfo stateInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster.StateInfo, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.Builder, + com.google.cloud.redis.cluster.v1.Cluster.StateInfoOrBuilder> + stateInfoBuilder_; + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + public boolean hasStateInfo() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo getStateInfo() { + if (stateInfoBuilder_ == null) { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } else { + return stateInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo(com.google.cloud.redis.cluster.v1.Cluster.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateInfo_ = value; + } else { + stateInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo( + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.Builder builderForValue) { + if (stateInfoBuilder_ == null) { + stateInfo_ = builderForValue.build(); + } else { + stateInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStateInfo(com.google.cloud.redis.cluster.v1.Cluster.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && stateInfo_ != null + && stateInfo_ + != com.google.cloud.redis.cluster.v1.Cluster.StateInfo.getDefaultInstance()) { + getStateInfoBuilder().mergeFrom(value); + } else { + stateInfo_ = value; + } + } else { + stateInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateInfo() { + bitField0_ = (bitField0_ & ~0x00001000); + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.Cluster.StateInfo.Builder getStateInfoBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getStateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.Cluster.StateInfoOrBuilder getStateInfoOrBuilder() { + if (stateInfoBuilder_ != null) { + return stateInfoBuilder_.getMessageOrBuilder(); + } else { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster.StateInfo, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.Builder, + com.google.cloud.redis.cluster.v1.Cluster.StateInfoOrBuilder> + getStateInfoFieldBuilder() { + if (stateInfoBuilder_ == null) { + stateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster.StateInfo, + com.google.cloud.redis.cluster.v1.Cluster.StateInfo.Builder, + com.google.cloud.redis.cluster.v1.Cluster.StateInfoOrBuilder>( + getStateInfo(), getParentForChildren(), isClean()); + stateInfo_ = null; + } + return stateInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1.Cluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.Cluster) + private static final com.google.cloud.redis.cluster.v1.Cluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.Cluster(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.Cluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ClusterName.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ClusterName.java new file mode 100644 index 000000000000..19799e96db8e --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ClusterName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ClusterOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ClusterOrBuilder.java new file mode 100644 index 000000000000..e4eaaf2820bc --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ClusterOrBuilder.java @@ -0,0 +1,533 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface ClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.Cluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The current state of this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.redis.cluster.v1.Cluster.State getState(); + + /** + * + * + *
+   * Output only. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + boolean hasReplicaCount(); + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + int getReplicaCount(); + + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + int getAuthorizationModeValue(); + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The authorizationMode. + */ + com.google.cloud.redis.cluster.v1.AuthorizationMode getAuthorizationMode(); + + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + int getTransitEncryptionModeValue(); + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transitEncryptionMode. + */ + com.google.cloud.redis.cluster.v1.TransitEncryptionMode getTransitEncryptionMode(); + + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the sizeGb field is set. + */ + boolean hasSizeGb(); + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + int getSizeGb(); + + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the shardCount field is set. + */ + boolean hasShardCount(); + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shardCount. + */ + int getShardCount(); + + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPscConfigsList(); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1.PscConfig getPscConfigs(int index); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPscConfigsCount(); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPscConfigsOrBuilderList(); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder getPscConfigsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDiscoveryEndpointsList(); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint getDiscoveryEndpoints(int index); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDiscoveryEndpointsCount(); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDiscoveryEndpointsOrBuilderList(); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1.DiscoveryEndpointOrBuilder getDiscoveryEndpointsOrBuilder( + int index); + + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPscConnectionsList(); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1.PscConnection getPscConnections(int index); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPscConnectionsCount(); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPscConnectionsOrBuilderList(); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1.PscConnectionOrBuilder getPscConnectionsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + boolean hasStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + com.google.cloud.redis.cluster.v1.Cluster.StateInfo getStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1.Cluster.StateInfoOrBuilder getStateInfoOrBuilder(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CreateClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CreateClusterRequest.java new file mode 100644 index 000000000000..d4741581c69c --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CreateClusterRequest.java @@ -0,0 +1,1354 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Request for [CreateCluster][CloudRedis.CreateCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.CreateClusterRequest} + */ +public final class CreateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.CreateClusterRequest.class, + com.google.cloud.redis.cluster.v1.CreateClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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 resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * 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.redis.cluster.v1.Cluster cluster_; + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.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 cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @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; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @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(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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.CreateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.CreateClusterRequest other = + (com.google.cloud.redis.cluster.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 (!getUnknownFields().equals(other.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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.CreateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.CreateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.CreateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.CreateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.CreateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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; + } + /** + * + * + *
+   * Request for [CreateCluster][CloudRedis.CreateCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.CreateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.CreateClusterRequest) + com.google.cloud.redis.cluster.v1.CreateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.CreateClusterRequest.class, + com.google.cloud.redis.cluster.v1.CreateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.CreateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.CreateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.CreateClusterRequest build() { + com.google.cloud.redis.cluster.v1.CreateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.CreateClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1.CreateClusterRequest result = + new com.google.cloud.redis.cluster.v1.CreateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.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_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1.CreateClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1.CreateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.CreateClusterRequest other) { + if (other == com.google.cloud.redis.cluster.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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.redis.cluster.v1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.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 cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.redis.cluster.v1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.redis.cluster.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 cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.redis.cluster.v1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.redis.cluster.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.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 cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1.CreateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.CreateClusterRequest) + private static final com.google.cloud.redis.cluster.v1.CreateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.CreateClusterRequest(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.CreateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CreateClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CreateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..d7ac643d925a --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/CreateClusterRequestOrBuilder.java @@ -0,0 +1,163 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface CreateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.CreateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.redis.cluster.v1.Cluster getCluster(); + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DeleteClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DeleteClusterRequest.java new file mode 100644 index 000000000000..2bcd64715d2f --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DeleteClusterRequest.java @@ -0,0 +1,835 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Request for [DeleteCluster][CloudRedis.DeleteCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.DeleteClusterRequest} + */ +public final class DeleteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteClusterRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.DeleteClusterRequest.class, + com.google.cloud.redis.cluster.v1.DeleteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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_ = ""; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @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; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + 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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.redis.cluster.v1.DeleteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.DeleteClusterRequest other = + (com.google.cloud.redis.cluster.v1.DeleteClusterRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.redis.cluster.v1.DeleteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.DeleteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.DeleteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.DeleteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.DeleteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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; + } + /** + * + * + *
+   * Request for [DeleteCluster][CloudRedis.DeleteCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.DeleteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.DeleteClusterRequest) + com.google.cloud.redis.cluster.v1.DeleteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.DeleteClusterRequest.class, + com.google.cloud.redis.cluster.v1.DeleteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DeleteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.DeleteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DeleteClusterRequest build() { + com.google.cloud.redis.cluster.v1.DeleteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DeleteClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1.DeleteClusterRequest result = + new com.google.cloud.redis.cluster.v1.DeleteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.DeleteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + 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.redis.cluster.v1.DeleteClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1.DeleteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.DeleteClusterRequest other) { + if (other == com.google.cloud.redis.cluster.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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.redis.cluster.v1.DeleteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.DeleteClusterRequest) + private static final com.google.cloud.redis.cluster.v1.DeleteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.DeleteClusterRequest(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.DeleteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DeleteClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DeleteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..e56a88d223a0 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DeleteClusterRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface DeleteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.DeleteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DiscoveryEndpoint.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DiscoveryEndpoint.java new file mode 100644 index 000000000000..f2823fd3e7f6 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DiscoveryEndpoint.java @@ -0,0 +1,1025 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Endpoints on each network, for Redis clients to connect to the cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.DiscoveryEndpoint} + */ +public final class DiscoveryEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1.DiscoveryEndpoint) + DiscoveryEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiscoveryEndpoint.newBuilder() to construct. + private DiscoveryEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DiscoveryEndpoint() { + address_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DiscoveryEndpoint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.class, + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder.class); + } + + public static final int ADDRESS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object address_ = ""; + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + @java.lang.Override + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_ = 0; + /** + * + * + *
+   * Output only. The port number of the exposed Redis endpoint.
+   * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + public static final int PSC_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.redis.cluster.v1.PscConfig pscConfig_; + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscConfig field is set. + */ + @java.lang.Override + public boolean hasPscConfig() { + return pscConfig_ != null; + } + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConfig. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfig getPscConfig() { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance() + : pscConfig_; + } + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfigOrBuilder getPscConfigOrBuilder() { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance() + : pscConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(address_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, address_); + } + if (port_ != 0) { + output.writeInt32(2, port_); + } + if (pscConfig_ != null) { + output.writeMessage(3, getPscConfig()); + } + 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(address_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, address_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, port_); + } + if (pscConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPscConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.DiscoveryEndpoint)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint other = + (com.google.cloud.redis.cluster.v1.DiscoveryEndpoint) obj; + + if (!getAddress().equals(other.getAddress())) return false; + if (getPort() != other.getPort()) return false; + if (hasPscConfig() != other.hasPscConfig()) return false; + if (hasPscConfig()) { + if (!getPscConfig().equals(other.getPscConfig())) 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) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + if (hasPscConfig()) { + hash = (37 * hash) + PSC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPscConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.redis.cluster.v1.DiscoveryEndpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Endpoints on each network, for Redis clients to connect to the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.DiscoveryEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.DiscoveryEndpoint) + com.google.cloud.redis.cluster.v1.DiscoveryEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.class, + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + address_ = ""; + port_ = 0; + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint build() { + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint buildPartial() { + com.google.cloud.redis.cluster.v1.DiscoveryEndpoint result = + new com.google.cloud.redis.cluster.v1.DiscoveryEndpoint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.DiscoveryEndpoint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.address_ = address_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.port_ = port_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pscConfig_ = pscConfigBuilder_ == null ? pscConfig_ : pscConfigBuilder_.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.redis.cluster.v1.DiscoveryEndpoint) { + return mergeFrom((com.google.cloud.redis.cluster.v1.DiscoveryEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.DiscoveryEndpoint other) { + if (other == com.google.cloud.redis.cluster.v1.DiscoveryEndpoint.getDefaultInstance()) + return this; + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + if (other.hasPscConfig()) { + mergePscConfig(other.getPscConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + port_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getPscConfigFieldBuilder().getBuilder(), extensionRegistry); + 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 address_ = ""; + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + address_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAddress() { + address_ = getDefaultInstance().getAddress(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for address to set. + * @return This builder for chaining. + */ + public Builder setAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + address_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int port_; + /** + * + * + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + /** + * + * + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000002); + port_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.redis.cluster.v1.PscConfig pscConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConfig, + com.google.cloud.redis.cluster.v1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder> + pscConfigBuilder_; + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscConfig field is set. + */ + public boolean hasPscConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConfig. + */ + public com.google.cloud.redis.cluster.v1.PscConfig getPscConfig() { + if (pscConfigBuilder_ == null) { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance() + : pscConfig_; + } else { + return pscConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConfig(com.google.cloud.redis.cluster.v1.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pscConfig_ = value; + } else { + pscConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConfig( + com.google.cloud.redis.cluster.v1.PscConfig.Builder builderForValue) { + if (pscConfigBuilder_ == null) { + pscConfig_ = builderForValue.build(); + } else { + pscConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePscConfig(com.google.cloud.redis.cluster.v1.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && pscConfig_ != null + && pscConfig_ != com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance()) { + getPscConfigBuilder().mergeFrom(value); + } else { + pscConfig_ = value; + } + } else { + pscConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPscConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConfig.Builder getPscConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getPscConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1.PscConfigOrBuilder getPscConfigOrBuilder() { + if (pscConfigBuilder_ != null) { + return pscConfigBuilder_.getMessageOrBuilder(); + } else { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance() + : pscConfig_; + } + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConfig, + com.google.cloud.redis.cluster.v1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder> + getPscConfigFieldBuilder() { + if (pscConfigBuilder_ == null) { + pscConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.PscConfig, + com.google.cloud.redis.cluster.v1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder>( + getPscConfig(), getParentForChildren(), isClean()); + pscConfig_ = null; + } + return pscConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1.DiscoveryEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.DiscoveryEndpoint) + private static final com.google.cloud.redis.cluster.v1.DiscoveryEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.DiscoveryEndpoint(); + } + + public static com.google.cloud.redis.cluster.v1.DiscoveryEndpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiscoveryEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.DiscoveryEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DiscoveryEndpointOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DiscoveryEndpointOrBuilder.java new file mode 100644 index 000000000000..a5ca6207aeaf --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/DiscoveryEndpointOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface DiscoveryEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.DiscoveryEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + java.lang.String getAddress(); + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + com.google.protobuf.ByteString getAddressBytes(); + + /** + * + * + *
+   * Output only. The port number of the exposed Redis endpoint.
+   * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + int getPort(); + + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscConfig field is set. + */ + boolean hasPscConfig(); + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConfig. + */ + com.google.cloud.redis.cluster.v1.PscConfig getPscConfig(); + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder getPscConfigOrBuilder(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/GetClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/GetClusterRequest.java new file mode 100644 index 000000000000..9a4c7424bed2 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/GetClusterRequest.java @@ -0,0 +1,652 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Request for [GetCluster][CloudRedis.GetCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.GetClusterRequest} + */ +public final class GetClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.GetClusterRequest.class, + com.google.cloud.redis.cluster.v1.GetClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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.redis.cluster.v1.GetClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.GetClusterRequest other = + (com.google.cloud.redis.cluster.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.redis.cluster.v1.GetClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.GetClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.GetClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.GetClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.GetClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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; + } + /** + * + * + *
+   * Request for [GetCluster][CloudRedis.GetCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.GetClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.GetClusterRequest) + com.google.cloud.redis.cluster.v1.GetClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.GetClusterRequest.class, + com.google.cloud.redis.cluster.v1.GetClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_GetClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.GetClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.GetClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.GetClusterRequest build() { + com.google.cloud.redis.cluster.v1.GetClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.GetClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1.GetClusterRequest result = + new com.google.cloud.redis.cluster.v1.GetClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.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.redis.cluster.v1.GetClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1.GetClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.GetClusterRequest other) { + if (other == com.google.cloud.redis.cluster.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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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.redis.cluster.v1.GetClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.GetClusterRequest) + private static final com.google.cloud.redis.cluster.v1.GetClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.GetClusterRequest(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.GetClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/GetClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/GetClusterRequestOrBuilder.java new file mode 100644 index 000000000000..0d8227c84142 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/GetClusterRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface GetClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.GetClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersRequest.java new file mode 100644 index 000000000000..a07fe6311607 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersRequest.java @@ -0,0 +1,959 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Request for [ListClusters][CloudRedis.ListClusters].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.ListClustersRequest} + */ +public final class ListClustersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.ListClustersRequest.class, + com.google.cloud.redis.cluster.v1.ListClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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 resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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; + /** + * + * + *
+   * The maximum number of items to return.
+   *
+   * If not specified, a default value of 1000 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token]
+   * to determine if there are more clusters left to be queried.
+   * 
+ * + * 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_ = ""; + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * 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.redis.cluster.v1.ListClustersRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.ListClustersRequest other = + (com.google.cloud.redis.cluster.v1.ListClustersRequest) 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.redis.cluster.v1.ListClustersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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; + } + /** + * + * + *
+   * Request for [ListClusters][CloudRedis.ListClusters].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.ListClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.ListClustersRequest) + com.google.cloud.redis.cluster.v1.ListClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.ListClustersRequest.class, + com.google.cloud.redis.cluster.v1.ListClustersRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ListClustersRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.ListClustersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ListClustersRequest build() { + com.google.cloud.redis.cluster.v1.ListClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ListClustersRequest buildPartial() { + com.google.cloud.redis.cluster.v1.ListClustersRequest result = + new com.google.cloud.redis.cluster.v1.ListClustersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.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_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1.ListClustersRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1.ListClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.ListClustersRequest other) { + if (other == com.google.cloud.redis.cluster.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * The maximum number of items to return.
+     *
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token]
+     * to determine if there are more clusters left to be queried.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     *
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token]
+     * to determine if there are more clusters left to be queried.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The maximum number of items to return.
+     *
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token]
+     * to determine if there are more clusters left to be queried.
+     * 
+ * + * 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_ = ""; + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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.redis.cluster.v1.ListClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.ListClustersRequest) + private static final com.google.cloud.redis.cluster.v1.ListClustersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.ListClustersRequest(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersRequestOrBuilder.java new file mode 100644 index 000000000000..7f9e29d532fd --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface ListClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.ListClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   *
+   * If not specified, a default value of 1000 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token]
+   * to determine if there are more clusters left to be queried.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersResponse.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersResponse.java new file mode 100644 index 000000000000..e5fb8734c443 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersResponse.java @@ -0,0 +1,1632 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Response for [ListClusters][CloudRedis.ListClusters].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.ListClustersResponse} + */ +public final class ListClustersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.ListClustersResponse.class, + com.google.cloud.redis.cluster.v1.ListClustersResponse.Builder.class); + } + + public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List clusters_; + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List getClustersList() { + return clusters_; + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List + getClustersOrBuilderList() { + return clusters_; + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + @java.lang.Override + public int getClustersCount() { + return clusters_.size(); + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster getClusters(int index) { + return clusters_.get(index); + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.redis.cluster.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_ = ""; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * 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.redis.cluster.v1.ListClustersResponse)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.ListClustersResponse other = + (com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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; + } + /** + * + * + *
+   * Response for [ListClusters][CloudRedis.ListClusters].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.ListClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.ListClustersResponse) + com.google.cloud.redis.cluster.v1.ListClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.ListClustersResponse.class, + com.google.cloud.redis.cluster.v1.ListClustersResponse.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_ListClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ListClustersResponse getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.ListClustersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ListClustersResponse build() { + com.google.cloud.redis.cluster.v1.ListClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ListClustersResponse buildPartial() { + com.google.cloud.redis.cluster.v1.ListClustersResponse result = + new com.google.cloud.redis.cluster.v1.ListClustersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.redis.cluster.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(); + } + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.ListClustersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1.ListClustersResponse) { + return mergeFrom((com.google.cloud.redis.cluster.v1.ListClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.ListClustersResponse other) { + if (other == com.google.cloud.redis.cluster.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_ |= 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.redis.cluster.v1.Cluster m = + input.readMessage( + com.google.cloud.redis.cluster.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.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder> + clustersBuilder_; + + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public java.util.List getClustersList() { + if (clustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusters_); + } else { + return clustersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public int getClustersCount() { + if (clustersBuilder_ == null) { + return clusters_.size(); + } else { + return clustersBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1.Cluster getClusters(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder setClusters(int index, com.google.cloud.redis.cluster.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; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder setClusters( + int index, com.google.cloud.redis.cluster.v1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.set(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.redis.cluster.v1.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(value); + onChanged(); + } else { + clustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder addClusters(int index, com.google.cloud.redis.cluster.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; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.redis.cluster.v1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder addClusters( + int index, com.google.cloud.redis.cluster.v1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.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; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder clearClusters() { + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clustersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public Builder removeClusters(int index) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.remove(index); + onChanged(); + } else { + clustersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1.Cluster.Builder getClustersBuilder(int index) { + return getClustersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClustersOrBuilder(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public java.util.List + getClustersOrBuilderList() { + if (clustersBuilder_ != null) { + return clustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusters_); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1.Cluster.Builder addClustersBuilder() { + return getClustersFieldBuilder() + .addBuilder(com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1.Cluster.Builder addClustersBuilder(int index) { + return getClustersFieldBuilder() + .addBuilder(index, com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + public java.util.List + getClustersBuilderList() { + return getClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder> + getClustersFieldBuilder() { + if (clustersBuilder_ == null) { + clustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder>( + clusters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + clusters_ = null; + } + return clustersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + 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() { + unreachable_.makeImmutable(); + 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); + } + /** + * + * + *
+     * 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); + bitField0_ |= 0x00000004; + 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); + bitField0_ |= 0x00000004; + 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_); + bitField0_ |= 0x00000004; + 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.emptyList(); + 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); + 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.redis.cluster.v1.ListClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.ListClustersResponse) + private static final com.google.cloud.redis.cluster.v1.ListClustersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.ListClustersResponse(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.ListClustersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersResponseOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersResponseOrBuilder.java new file mode 100644 index 000000000000..0104e6cf9876 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/ListClustersResponseOrBuilder.java @@ -0,0 +1,205 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface ListClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.ListClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + java.util.List getClustersList(); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + com.google.cloud.redis.cluster.v1.Cluster getClusters(int index); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + int getClustersCount(); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + java.util.List + getClustersOrBuilderList(); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1.Cluster clusters = 1; + */ + com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClustersOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/LocationName.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/LocationName.java new file mode 100644 index 000000000000..91ac95b38b95 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.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-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/OperationMetadata.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/OperationMetadata.java new file mode 100644 index 000000000000..5a658afa5405 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/OperationMetadata.java @@ -0,0 +1,1828 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Pre-defined metadata fields.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.OperationMetadata.class, + com.google.cloud.redis.cluster.v1.OperationMetadata.Builder.class); + } + + 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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.OperationMetadata other = + (com.google.cloud.redis.cluster.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 (!getUnknownFields().equals(other.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(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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; + } + /** + * + * + *
+   * Pre-defined metadata fields.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.OperationMetadata) + com.google.cloud.redis.cluster.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.OperationMetadata.class, + com.google.cloud.redis.cluster.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.OperationMetadata build() { + com.google.cloud.redis.cluster.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.OperationMetadata buildPartial() { + com.google.cloud.redis.cluster.v1.OperationMetadata result = + new com.google.cloud.redis.cluster.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.redis.cluster.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.OperationMetadata other) { + if (other == com.google.cloud.redis.cluster.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_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + 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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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_ & 0x00000001) != 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_ |= 0x00000001; + 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_ |= 0x00000001; + 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_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + 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_ & ~0x00000001); + 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_ |= 0x00000001; + 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_ & 0x00000002) != 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_ |= 0x00000002; + 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_ |= 0x00000002; + 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_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + 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_ & ~0x00000002); + 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_ |= 0x00000002; + 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_ |= 0x00000004; + 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_ & ~0x00000004); + 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_ |= 0x00000004; + 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_ |= 0x00000008; + 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_ & ~0x00000008); + 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_ |= 0x00000008; + 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_ |= 0x00000010; + 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_ & ~0x00000010); + 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_ |= 0x00000010; + 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_ |= 0x00000020; + 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_ & ~0x00000020); + 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_ |= 0x00000040; + 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_ & ~0x00000040); + 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_ |= 0x00000040; + 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.redis.cluster.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.OperationMetadata) + private static final com.google.cloud.redis.cluster.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.OperationMetadata(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/OperationMetadataOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..393c4d490d5e --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConfig.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConfig.java new file mode 100644 index 000000000000..21cf5008de53 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConfig.java @@ -0,0 +1,621 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** Protobuf type {@code google.cloud.redis.cluster.v1.PscConfig} */ +public final class PscConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1.PscConfig) + PscConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PscConfig.newBuilder() to construct. + private PscConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PscConfig() { + network_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PscConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.PscConfig.class, + com.google.cloud.redis.cluster.v1.PscConfig.Builder.class); + } + + public static final int NETWORK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Required. The network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, network_); + } + 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(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, network_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.PscConfig)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.PscConfig other = + (com.google.cloud.redis.cluster.v1.PscConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) 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) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.redis.cluster.v1.PscConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.redis.cluster.v1.PscConfig} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.PscConfig) + com.google.cloud.redis.cluster.v1.PscConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.PscConfig.class, + com.google.cloud.redis.cluster.v1.PscConfig.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1.PscConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + network_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfig getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfig build() { + com.google.cloud.redis.cluster.v1.PscConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfig buildPartial() { + com.google.cloud.redis.cluster.v1.PscConfig result = + new com.google.cloud.redis.cluster.v1.PscConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.PscConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.network_ = network_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1.PscConfig) { + return mergeFrom((com.google.cloud.redis.cluster.v1.PscConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.PscConfig other) { + if (other == com.google.cloud.redis.cluster.v1.PscConfig.getDefaultInstance()) return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + 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 18: + { + network_ = 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 network_ = ""; + /** + * + * + *
+     * Required. The network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 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.redis.cluster.v1.PscConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.PscConfig) + private static final com.google.cloud.redis.cluster.v1.PscConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.PscConfig(); + } + + public static com.google.cloud.redis.cluster.v1.PscConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConfigOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConfigOrBuilder.java new file mode 100644 index 000000000000..02dc2294cac4 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConfigOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface PscConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.PscConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConnection.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConnection.java new file mode 100644 index 000000000000..958e61fab4b1 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConnection.java @@ -0,0 +1,1394 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Details of consumer resources in a PSC connection.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.PscConnection} + */ +public final class PscConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1.PscConnection) + PscConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PscConnection.newBuilder() to construct. + private PscConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PscConnection() { + pscConnectionId_ = ""; + address_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PscConnection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.PscConnection.class, + com.google.cloud.redis.cluster.v1.PscConnection.Builder.class); + } + + public static final int PSC_CONNECTION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object pscConnectionId_ = ""; + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pscConnectionId. + */ + @java.lang.Override + public java.lang.String getPscConnectionId() { + java.lang.Object ref = pscConnectionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscConnectionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pscConnectionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPscConnectionIdBytes() { + java.lang.Object ref = pscConnectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscConnectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object address_ = ""; + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + @java.lang.Override + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORWARDING_RULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The forwardingRule. + */ + @java.lang.Override + public java.lang.String getForwardingRule() { + java.lang.Object ref = forwardingRule_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + forwardingRule_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for forwardingRule. + */ + @java.lang.Override + public com.google.protobuf.ByteString getForwardingRuleBytes() { + java.lang.Object ref = forwardingRule_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + forwardingRule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object projectId_ = ""; + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NETWORK_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @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; + } + } + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(pscConnectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, address_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(forwardingRule_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, forwardingRule_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, network_); + } + 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(pscConnectionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, address_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(forwardingRule_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, forwardingRule_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, network_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.PscConnection)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.PscConnection other = + (com.google.cloud.redis.cluster.v1.PscConnection) obj; + + if (!getPscConnectionId().equals(other.getPscConnectionId())) return false; + if (!getAddress().equals(other.getAddress())) return false; + if (!getForwardingRule().equals(other.getForwardingRule())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getNetwork().equals(other.getNetwork())) 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) + PSC_CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPscConnectionId().hashCode(); + hash = (37 * hash) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + hash = (37 * hash) + FORWARDING_RULE_FIELD_NUMBER; + hash = (53 * hash) + getForwardingRule().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.redis.cluster.v1.PscConnection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 consumer resources in a PSC connection.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.PscConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.PscConnection) + com.google.cloud.redis.cluster.v1.PscConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.PscConnection.class, + com.google.cloud.redis.cluster.v1.PscConnection.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1.PscConnection.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pscConnectionId_ = ""; + address_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_PscConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConnection getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.PscConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConnection build() { + com.google.cloud.redis.cluster.v1.PscConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConnection buildPartial() { + com.google.cloud.redis.cluster.v1.PscConnection result = + new com.google.cloud.redis.cluster.v1.PscConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1.PscConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pscConnectionId_ = pscConnectionId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.address_ = address_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.forwardingRule_ = forwardingRule_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.network_ = network_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1.PscConnection) { + return mergeFrom((com.google.cloud.redis.cluster.v1.PscConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.PscConnection other) { + if (other == com.google.cloud.redis.cluster.v1.PscConnection.getDefaultInstance()) + return this; + if (!other.getPscConnectionId().isEmpty()) { + pscConnectionId_ = other.pscConnectionId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getForwardingRule().isEmpty()) { + forwardingRule_ = other.forwardingRule_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + 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: + { + pscConnectionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + forwardingRule_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + projectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + network_ = 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 pscConnectionId_ = ""; + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pscConnectionId. + */ + public java.lang.String getPscConnectionId() { + java.lang.Object ref = pscConnectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscConnectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pscConnectionId. + */ + public com.google.protobuf.ByteString getPscConnectionIdBytes() { + java.lang.Object ref = pscConnectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscConnectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The pscConnectionId to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pscConnectionId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPscConnectionId() { + pscConnectionId_ = getDefaultInstance().getPscConnectionId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for pscConnectionId to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pscConnectionId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object address_ = ""; + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + address_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAddress() { + address_ = getDefaultInstance().getAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for address to set. + * @return This builder for chaining. + */ + public Builder setAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + address_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The forwardingRule. + */ + public java.lang.String getForwardingRule() { + java.lang.Object ref = forwardingRule_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + forwardingRule_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for forwardingRule. + */ + public com.google.protobuf.ByteString getForwardingRuleBytes() { + java.lang.Object ref = forwardingRule_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + forwardingRule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The forwardingRule to set. + * @return This builder for chaining. + */ + public Builder setForwardingRule(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + forwardingRule_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearForwardingRule() { + forwardingRule_ = getDefaultInstance().getForwardingRule(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for forwardingRule to set. + * @return This builder for chaining. + */ + public Builder setForwardingRuleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + forwardingRule_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + projectId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + projectId_ = getDefaultInstance().getProjectId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + projectId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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; + } + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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; + } + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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_ |= 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.redis.cluster.v1.PscConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.PscConnection) + private static final com.google.cloud.redis.cluster.v1.PscConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.PscConnection(); + } + + public static com.google.cloud.redis.cluster.v1.PscConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscConnection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.PscConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConnectionOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConnectionOrBuilder.java new file mode 100644 index 000000000000..219d8e08e03f --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/PscConnectionOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface PscConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.PscConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pscConnectionId. + */ + java.lang.String getPscConnectionId(); + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pscConnectionId. + */ + com.google.protobuf.ByteString getPscConnectionIdBytes(); + + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + java.lang.String getAddress(); + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + com.google.protobuf.ByteString getAddressBytes(); + + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The forwardingRule. + */ + java.lang.String getForwardingRule(); + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for forwardingRule. + */ + com.google.protobuf.ByteString getForwardingRuleBytes(); + + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/TransitEncryptionMode.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/TransitEncryptionMode.java new file mode 100644 index 000000000000..d2108cc20a7c --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/TransitEncryptionMode.java @@ -0,0 +1,181 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Available mode of in-transit encryption.
+ * 
+ * + * Protobuf enum {@code google.cloud.redis.cluster.v1.TransitEncryptionMode} + */ +public enum TransitEncryptionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * In-transit encryption not set.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED(0), + /** + * + * + *
+   * In-transit encryption disabled.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + */ + TRANSIT_ENCRYPTION_MODE_DISABLED(1), + /** + * + * + *
+   * Use server managed encryption for in-transit encryption.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + */ + TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * In-transit encryption not set.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + public static final int TRANSIT_ENCRYPTION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * In-transit encryption disabled.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + */ + public static final int TRANSIT_ENCRYPTION_MODE_DISABLED_VALUE = 1; + /** + * + * + *
+   * Use server managed encryption for in-transit encryption.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + */ + public static final int TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION_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 TransitEncryptionMode 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 TransitEncryptionMode forNumber(int value) { + switch (value) { + case 0: + return TRANSIT_ENCRYPTION_MODE_UNSPECIFIED; + case 1: + return TRANSIT_ENCRYPTION_MODE_DISABLED; + case 2: + return TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION; + 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 TransitEncryptionMode findValueByNumber(int number) { + return TransitEncryptionMode.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.redis.cluster.v1.CloudRedisClusterProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final TransitEncryptionMode[] VALUES = values(); + + public static TransitEncryptionMode 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 TransitEncryptionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.redis.cluster.v1.TransitEncryptionMode) +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/UpdateClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/UpdateClusterRequest.java new file mode 100644 index 000000000000..4ea4aab603d3 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/UpdateClusterRequest.java @@ -0,0 +1,1257 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +/** + * + * + *
+ * Request for [UpdateCluster][CloudRedis.UpdateCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.UpdateClusterRequest} + */ +public final class UpdateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.UpdateClusterRequest.class, + com.google.cloud.redis.cluster.v1.UpdateClusterRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @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.redis.cluster.v1.Cluster cluster_; + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.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. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @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; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @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 (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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1.UpdateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1.UpdateClusterRequest other = + (com.google.cloud.redis.cluster.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 (!getUnknownFields().equals(other.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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1.UpdateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.UpdateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.UpdateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.UpdateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.UpdateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.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.redis.cluster.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.redis.cluster.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; + } + /** + * + * + *
+   * Request for [UpdateCluster][CloudRedis.UpdateCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1.UpdateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1.UpdateClusterRequest) + com.google.cloud.redis.cluster.v1.UpdateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1.UpdateClusterRequest.class, + com.google.cloud.redis.cluster.v1.UpdateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.UpdateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1.UpdateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.UpdateClusterRequest build() { + com.google.cloud.redis.cluster.v1.UpdateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1.UpdateClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1.UpdateClusterRequest result = + new com.google.cloud.redis.cluster.v1.UpdateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.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_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1.UpdateClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1.UpdateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1.UpdateClusterRequest other) { + if (other == com.google.cloud.redis.cluster.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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.redis.cluster.v1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.redis.cluster.v1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.redis.cluster.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.redis.cluster.v1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.redis.cluster.v1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.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. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1.Cluster, + com.google.cloud.redis.cluster.v1.Cluster.Builder, + com.google.cloud.redis.cluster.v1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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.redis.cluster.v1.UpdateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1.UpdateClusterRequest) + private static final com.google.cloud.redis.cluster.v1.UpdateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1.UpdateClusterRequest(); + } + + public static com.google.cloud.redis.cluster.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.redis.cluster.v1.UpdateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/UpdateClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/UpdateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..c038ca63e711 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/java/com/google/cloud/redis/cluster/v1/UpdateClusterRequestOrBuilder.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1; + +public interface UpdateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1.UpdateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.redis.cluster.v1.Cluster getCluster(); + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/proto/google/cloud/redis/cluster/v1/cloud_redis_cluster.proto b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/proto/google/cloud/redis/cluster/v1/cloud_redis_cluster.proto new file mode 100644 index 000000000000..1c37082cf807 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1/src/main/proto/google/cloud/redis/cluster/v1/cloud_redis_cluster.proto @@ -0,0 +1,453 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.redis.cluster.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/redis/cluster/apiv1/clusterpb;clusterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudRedisClusterProto"; +option java_package = "com.google.cloud.redis.cluster.v1"; + +// Configures and manages Cloud Memorystore for Redis clusters +// +// Google Cloud Memorystore for Redis Cluster +// +// The `redis.googleapis.com` service implements the Google Cloud Memorystore +// for Redis API and defines the following resource model for managing Redis +// clusters: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of Redis clusters, named: `/clusters/*` +// * As such, Redis clusters are resources of the form: +// `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` +// +// Note that location_id must be a GCP `region`; for example: +// * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` +// +// We use API version selector for Flex APIs +// * The versioning strategy is release-based versioning +// * Our backend CLH only deals with the superset version (called v1main) +// * Existing backend for Redis Gen1 and MRR is not touched. +// * More details in go/redis-flex-api-versioning +service CloudRedisCluster { + option (google.api.default_host) = "redis.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all Redis clusters owned by a project in either the specified + // location (region) or all locations. + // + // The location should have the following format: + // + // * `projects/{project_id}/locations/{location_id}` + // + // If `location_id` is specified as `-` (wildcard), then all regions + // available to the project are queried, and the results are aggregated. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific Redis cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the metadata and configuration of a specific Redis cluster. + // + // Completed longrunning.Operation will contain the new cluster object + // in the response field. The returned operation is automatically deleted + // after a few hours, so there is no need to call DeleteOperation. + 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: "google.protobuf.Any" + }; + } + + // Deletes a specific Redis cluster. Cluster stops serving and data is + // deleted. + 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: "google.protobuf.Any" + }; + } + + // Creates a Redis cluster based on the specified properties. + // The creation is executed asynchronously and callers may check the returned + // operation to track its progress. Once the operation is completed the Redis + // cluster will be fully functional. The completed longrunning.Operation will + // contain the new cluster object in the response field. + // + // The returned operation is automatically deleted after a few hours, so there + // is no need to call DeleteOperation. + 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: "google.protobuf.Any" + }; + } +} + +// Available authorization mode of a Redis cluster. +enum AuthorizationMode { + // Not set. + AUTH_MODE_UNSPECIFIED = 0; + + // IAM basic authorization mode + AUTH_MODE_IAM_AUTH = 1; + + // Authorization disabled mode + AUTH_MODE_DISABLED = 2; +} + +// Available mode of in-transit encryption. +enum TransitEncryptionMode { + // In-transit encryption not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + + // In-transit encryption disabled. + TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + + // Use server managed encryption for in-transit encryption. + TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; +} + +// Request for [CreateCluster][CloudRedis.CreateCluster]. +message CreateClusterRequest { + // Required. The resource name of the cluster location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The logical name of the Redis cluster in the customer project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the customer project / location + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster that is to be created. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 4; +} + +// Request for [ListClusters][CloudRedis.ListClusters]. +message ListClustersRequest { + // Required. The resource name of the cluster location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + // + // If not specified, a default value of 1000 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [`next_page_token`][google.cloud.redis.cluster.v1.ListClustersResponse.next_page_token] + // to determine if there are more clusters left to be queried. + int32 page_size = 2; + + // The `next_page_token` value returned from a previous + // [ListClusters][CloudRedis.ListClusters] request, if any. + string page_token = 3; +} + +// Response for [ListClusters][CloudRedis.ListClusters]. +message ListClustersResponse { + // A list of Redis clusters in the project in the specified location, + // or across all locations. + // + // If the `location_id` in the parent field of the request is "-", all regions + // available to the project are queried, and the results aggregated. + // If in such an aggregated query a location is unavailable, a placeholder + // Redis entry is included in the response with the `name` field set to a + // value of the form + // `projects/{project_id}/locations/{location_id}/clusters/`- and the + // `status` field set to ERROR and `status_message` field set to "location not + // available for ListClusters". + repeated Cluster clusters = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [UpdateCluster][CloudRedis.UpdateCluster]. +message UpdateClusterRequest { + // Required. Mask of fields to update. At least one path must be supplied in + // this field. The elements of the repeated paths field may only include these + // fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]: + // + // * `size_gb` + // * `replica_count` + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in update_mask are updated. + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 3; +} + +// Request for [GetCluster][CloudRedis.GetCluster]. +message GetClusterRequest { + // Required. Redis cluster resource name using the form: + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + // where `location_id` refers to a GCP region. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "redis.googleapis.com/Cluster" } + ]; +} + +// Request for [DeleteCluster][CloudRedis.DeleteCluster]. +message DeleteClusterRequest { + // Required. Redis cluster resource name using the form: + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + // where `location_id` refers to a GCP region. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "redis.googleapis.com/Cluster" } + ]; + + // Idempotent request UUID. + string request_id = 2; +} + +// A cluster instance. +message Cluster { + option (google.api.resource) = { + type: "redis.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + }; + + // Represents additional information about the state of the cluster. + message StateInfo { + // Represents information about an updating cluster. + message UpdateInfo { + // Target number of shards for redis cluster + optional int32 target_shard_count = 1; + + // Target number of replica nodes per shard. + optional int32 target_replica_count = 2; + } + + oneof info { + // Describes ongoing update on the cluster when cluster state is UPDATING. + UpdateInfo update_info = 1; + } + } + + // Represents the different states of a Redis cluster. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // Redis cluster is being created. + CREATING = 1; + + // Redis cluster has been created and is fully usable. + ACTIVE = 2; + + // Redis cluster configuration is being updated. + UPDATING = 3; + + // Redis cluster is being deleted. + DELETING = 4; + } + + // Required. Unique name of the resource in this scope including project and + // location using the form: + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp associated with the cluster creation request. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this cluster. + // Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. System assigned, unique identifier for the cluster. + string uid = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The number of replica nodes per shard. + optional int32 replica_count = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The authorization mode of the Redis cluster. + // If not provided, auth feature is disabled for the cluster. + AuthorizationMode authorization_mode = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + TransitEncryptionMode transit_encryption_mode = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Redis memory size in GB for the entire cluster. + optional int32 size_gb = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Number of shards for the Redis cluster. + optional int32 shard_count = 14 [(google.api.field_behavior) = REQUIRED]; + + // Required. Each PscConfig configures the consumer network where IPs will + // be designated to the cluster for client access through Private Service + // Connect Automation. Currently, only one PscConfig is supported. + repeated PscConfig psc_configs = 15 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Endpoints created on each given network, for Redis clients to + // connect to the cluster. Currently only one discovery endpoint is supported. + repeated DiscoveryEndpoint discovery_endpoints = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. PSC connections for discovery of the cluster topology and + // accessing the cluster. + repeated PscConnection psc_connections = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the current state of the cluster. + StateInfo state_info = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message PscConfig { + // Required. The network where the IP address of the discovery endpoint will + // be reserved, in the form of + // projects/{network_project}/global/networks/{network_id}. + string network = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Endpoints on each network, for Redis clients to connect to the cluster. +message DiscoveryEndpoint { + // Output only. Address of the exposed Redis endpoint used by clients to + // connect to the service. The address could be either IP or hostname. + string address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the exposed Redis endpoint. + int32 port = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Customer configuration for where the endpoint is created and + // accessed from. + PscConfig psc_config = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details of consumer resources in a PSC connection. +message PscConnection { + // Output only. The PSC connection id of the forwarding rule connected to the + // service attachment. + string psc_connection_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The IP allocated on the consumer network for the PSC + // forwarding rule. + string address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The URI of the consumer side forwarding rule. + // Example: + // projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + string forwarding_rule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The consumer project_id where the forwarding rule is created + // from. + string project_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The consumer network where the IP address resides, in the form of + // projects/{project_id}/global/networks/{network_id}. + string network = 5; +} + +// Pre-defined metadata fields. +message OperationMetadata { + // 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-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/clirr-ignored-differences.xml b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..d4a909fcf522 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/clirr-ignored-differences.xml @@ -0,0 +1,19 @@ + + + + + 7012 + com/google/cloud/redis/cluster/v1beta1/*OrBuilder + * get*(*) + + + 7012 + com/google/cloud/redis/cluster/v1beta1/*OrBuilder + boolean contains*(*) + + + 7012 + com/google/cloud/redis/cluster/v1beta1/*OrBuilder + boolean has*(*) + + diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/pom.xml b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/pom.xml new file mode 100644 index 000000000000..22865f577430 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-redis-cluster-v1beta1 + 0.0.1-SNAPSHOT + proto-google-cloud-redis-cluster-v1beta1 + Proto library for google-cloud-redis-cluster + + com.google.cloud + google-cloud-redis-cluster-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-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/AuthorizationMode.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/AuthorizationMode.java new file mode 100644 index 000000000000..7153d96c38c1 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/AuthorizationMode.java @@ -0,0 +1,180 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Available authorization mode of a Redis cluster.
+ * 
+ * + * Protobuf enum {@code google.cloud.redis.cluster.v1beta1.AuthorizationMode} + */ +public enum AuthorizationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Not set.
+   * 
+ * + * AUTH_MODE_UNSPECIFIED = 0; + */ + AUTH_MODE_UNSPECIFIED(0), + /** + * + * + *
+   * IAM basic authorization mode
+   * 
+ * + * AUTH_MODE_IAM_AUTH = 1; + */ + AUTH_MODE_IAM_AUTH(1), + /** + * + * + *
+   * Authorization disabled mode
+   * 
+ * + * AUTH_MODE_DISABLED = 2; + */ + AUTH_MODE_DISABLED(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Not set.
+   * 
+ * + * AUTH_MODE_UNSPECIFIED = 0; + */ + public static final int AUTH_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * IAM basic authorization mode
+   * 
+ * + * AUTH_MODE_IAM_AUTH = 1; + */ + public static final int AUTH_MODE_IAM_AUTH_VALUE = 1; + /** + * + * + *
+   * Authorization disabled mode
+   * 
+ * + * AUTH_MODE_DISABLED = 2; + */ + public static final int AUTH_MODE_DISABLED_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 AuthorizationMode 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 AuthorizationMode forNumber(int value) { + switch (value) { + case 0: + return AUTH_MODE_UNSPECIFIED; + case 1: + return AUTH_MODE_IAM_AUTH; + case 2: + return AUTH_MODE_DISABLED; + 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 AuthorizationMode findValueByNumber(int number) { + return AuthorizationMode.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.redis.cluster.v1beta1.CloudRedisClusterProto.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AuthorizationMode[] VALUES = values(); + + public static AuthorizationMode 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 AuthorizationMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.redis.cluster.v1beta1.AuthorizationMode) +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterProto.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterProto.java new file mode 100644 index 000000000000..77b4128027d7 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CloudRedisClusterProto.java @@ -0,0 +1,374 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public final class CloudRedisClusterProto { + private CloudRedisClusterProto() {} + + 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_redis_cluster_v1beta1_CreateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_CreateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_ListClustersRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_ListClustersRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_ListClustersResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_ListClustersResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_UpdateClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_UpdateClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_GetClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_GetClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_DeleteClusterRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_DeleteClusterRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_Cluster_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_Cluster_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_UpdateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_UpdateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_PscConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_PscConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_DiscoveryEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_DiscoveryEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_PscConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_PscConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_redis_cluster_v1beta1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_redis_cluster_v1beta1_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 + * A cluster instance. + * + * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.Cluster} + */ +public final class Cluster extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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_ = ""; + state_ = 0; + uid_ = ""; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + pscConfigs_ = java.util.Collections.emptyList(); + discoveryEndpoints_ = java.util.Collections.emptyList(); + pscConnections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Cluster(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.Cluster.class, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder.class); + } + + /** + * + * + *
+   * Represents the different states of a Redis cluster.
+   * 
+ * + * Protobuf enum {@code google.cloud.redis.cluster.v1beta1.Cluster.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Redis cluster is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Redis cluster has been created and is fully usable.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + /** + * + * + *
+     * Redis cluster configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+     * Redis cluster is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Redis cluster is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Redis cluster has been created and is fully usable.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + /** + * + * + *
+     * Redis cluster configuration is being updated.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + * + * + *
+     * Redis cluster 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 CREATING; + case 2: + return ACTIVE; + case 3: + return UPDATING; + 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.redis.cluster.v1beta1.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.redis.cluster.v1beta1.Cluster.State) + } + + public interface StateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * + * @return Whether the updateInfo field is set. + */ + boolean hasUpdateInfo(); + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * + * @return The updateInfo. + */ + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo getUpdateInfo(); + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder(); + + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.InfoCase getInfoCase(); + } + /** + * + * + *
+   * Represents additional information about the state of the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.Cluster.StateInfo} + */ + public static final class StateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo) + StateInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateInfo.newBuilder() to construct. + private StateInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private StateInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new StateInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.class, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.Builder.class); + } + + public interface UpdateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return Whether the targetShardCount field is set. + */ + boolean hasTargetShardCount(); + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return The targetShardCount. + */ + int getTargetShardCount(); + + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return Whether the targetReplicaCount field is set. + */ + boolean hasTargetReplicaCount(); + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return The targetReplicaCount. + */ + int getTargetReplicaCount(); + } + /** + * + * + *
+     * Represents information about an updating cluster.
+     * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo} + */ + public static final class UpdateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) + UpdateInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInfo.newBuilder() to construct. + private UpdateInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInfo() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.class, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.Builder.class); + } + + private int bitField0_; + public static final int TARGET_SHARD_COUNT_FIELD_NUMBER = 1; + private int targetShardCount_ = 0; + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Target number of shards for redis cluster
+       * 
+ * + * optional int32 target_shard_count = 1; + * + * @return The targetShardCount. + */ + @java.lang.Override + public int getTargetShardCount() { + return targetShardCount_; + } + + public static final int TARGET_REPLICA_COUNT_FIELD_NUMBER = 2; + private int targetReplicaCount_ = 0; + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Target number of replica nodes per shard.
+       * 
+ * + * optional int32 target_replica_count = 2; + * + * @return The targetReplicaCount. + */ + @java.lang.Override + public int getTargetReplicaCount() { + return targetReplicaCount_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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.writeInt32(1, targetShardCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(2, targetReplicaCount_); + } + 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.computeInt32Size(1, targetShardCount_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, targetReplicaCount_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo other = + (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) obj; + + if (hasTargetShardCount() != other.hasTargetShardCount()) return false; + if (hasTargetShardCount()) { + if (getTargetShardCount() != other.getTargetShardCount()) return false; + } + if (hasTargetReplicaCount() != other.hasTargetReplicaCount()) return false; + if (hasTargetReplicaCount()) { + if (getTargetReplicaCount() != other.getTargetReplicaCount()) 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 (hasTargetShardCount()) { + hash = (37 * hash) + TARGET_SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTargetShardCount(); + } + if (hasTargetReplicaCount()) { + hash = (37 * hash) + TARGET_REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getTargetReplicaCount(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 information about an updating cluster.
+       * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.class, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.Builder + .class); + } + + // Construct using + // com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + targetShardCount_ = 0; + targetReplicaCount_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo build() { + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo buildPartial() { + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo result = + new com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.targetShardCount_ = targetShardCount_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.targetReplicaCount_ = targetReplicaCount_; + to_bitField0_ |= 0x00000002; + } + 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.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) { + return mergeFrom( + (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo other) { + if (other + == com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance()) return this; + if (other.hasTargetShardCount()) { + setTargetShardCount(other.getTargetShardCount()); + } + if (other.hasTargetReplicaCount()) { + setTargetReplicaCount(other.getTargetReplicaCount()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + targetShardCount_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + targetReplicaCount_ = input.readInt32(); + 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 targetShardCount_; + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @return The targetShardCount. + */ + @java.lang.Override + public int getTargetShardCount() { + return targetShardCount_; + } + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @param value The targetShardCount to set. + * @return This builder for chaining. + */ + public Builder setTargetShardCount(int value) { + + targetShardCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Target number of shards for redis cluster
+         * 
+ * + * optional int32 target_shard_count = 1; + * + * @return This builder for chaining. + */ + public Builder clearTargetShardCount() { + bitField0_ = (bitField0_ & ~0x00000001); + targetShardCount_ = 0; + onChanged(); + return this; + } + + private int targetReplicaCount_; + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @return The targetReplicaCount. + */ + @java.lang.Override + public int getTargetReplicaCount() { + return targetReplicaCount_; + } + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @param value The targetReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setTargetReplicaCount(int value) { + + targetReplicaCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Target number of replica nodes per shard.
+         * 
+ * + * optional int32 target_replica_count = 2; + * + * @return This builder for chaining. + */ + public Builder clearTargetReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000002); + targetReplicaCount_ = 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.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) + private static final com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo(); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int infoCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object info_; + + public enum InfoCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + UPDATE_INFO(1), + INFO_NOT_SET(0); + private final int value; + + private InfoCase(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 InfoCase valueOf(int value) { + return forNumber(value); + } + + public static InfoCase forNumber(int value) { + switch (value) { + case 1: + return UPDATE_INFO; + case 0: + return INFO_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public InfoCase getInfoCase() { + return InfoCase.forNumber(infoCase_); + } + + public static final int UPDATE_INFO_FIELD_NUMBER = 1; + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo getUpdateInfo() { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + /** + * + * + *
+     * Describes ongoing update on the cluster when cluster state is UPDATING.
+     * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (infoCase_ == 1) { + output.writeMessage( + 1, (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (infoCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo other = + (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo) obj; + + if (!getInfoCase().equals(other.getInfoCase())) return false; + switch (infoCase_) { + case 1: + if (!getUpdateInfo().equals(other.getUpdateInfo())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (infoCase_) { + case 1: + hash = (37 * hash) + UPDATE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getUpdateInfo().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 additional information about the state of the cluster.
+     * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.Cluster.StateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo) + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.class, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (updateInfoBuilder_ != null) { + updateInfoBuilder_.clear(); + } + infoCase_ = 0; + info_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_StateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo build() { + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo buildPartial() { + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo result = + new com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo result) { + result.infoCase_ = infoCase_; + result.info_ = this.info_; + if (infoCase_ == 1 && updateInfoBuilder_ != null) { + result.info_ = updateInfoBuilder_.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.redis.cluster.v1beta1.Cluster.StateInfo) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo other) { + if (other == com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.getDefaultInstance()) + return this; + switch (other.getInfoCase()) { + case UPDATE_INFO: + { + mergeUpdateInfo(other.getUpdateInfo()); + break; + } + case INFO_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(getUpdateInfoFieldBuilder().getBuilder(), extensionRegistry); + infoCase_ = 1; + 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 infoCase_ = 0; + private java.lang.Object info_; + + public InfoCase getInfoCase() { + return InfoCase.forNumber(infoCase_); + } + + public Builder clearInfo() { + infoCase_ = 0; + info_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.Builder, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoOrBuilder> + updateInfoBuilder_; + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo getUpdateInfo() { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } else { + if (infoCase_ == 1) { + return updateInfoBuilder_.getMessage(); + } + return com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + public Builder setUpdateInfo( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + onChanged(); + } else { + updateInfoBuilder_.setMessage(value); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + public Builder setUpdateInfo( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.Builder + builderForValue) { + if (updateInfoBuilder_ == null) { + info_ = builderForValue.build(); + onChanged(); + } else { + updateInfoBuilder_.setMessage(builderForValue.build()); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + public Builder mergeUpdateInfo( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1 + && info_ + != com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance()) { + info_ = + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.newBuilder( + (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_) + .mergeFrom(value) + .buildPartial(); + } else { + info_ = value; + } + onChanged(); + } else { + if (infoCase_ == 1) { + updateInfoBuilder_.mergeFrom(value); + } else { + updateInfoBuilder_.setMessage(value); + } + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + public Builder clearUpdateInfo() { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1) { + infoCase_ = 0; + info_ = null; + onChanged(); + } + } else { + if (infoCase_ == 1) { + infoCase_ = 0; + info_ = null; + } + updateInfoBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.Builder + getUpdateInfoBuilder() { + return getUpdateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if ((infoCase_ == 1) && (updateInfoBuilder_ != null)) { + return updateInfoBuilder_.getMessageOrBuilder(); + } else { + if (infoCase_ == 1) { + return (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Describes ongoing update on the cluster when cluster state is UPDATING.
+       * 
+ * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo update_info = 1; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.Builder, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoOrBuilder> + getUpdateInfoFieldBuilder() { + if (updateInfoBuilder_ == null) { + if (!(infoCase_ == 1)) { + info_ = + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo + .getDefaultInstance(); + } + updateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo.Builder, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfoOrBuilder>( + (com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.UpdateInfo) info_, + getParentForChildren(), + isClean()); + info_ = null; + } + infoCase_ = 1; + onChanged(); + return updateInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.Cluster.StateInfo) + private static final com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo(); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CREATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.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 STATE_FIELD_NUMBER = 4; + private int state_ = 0; + /** + * + * + *
+   * Output only. The current state of this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.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 this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.State getState() { + com.google.cloud.redis.cluster.v1beta1.Cluster.State result = + com.google.cloud.redis.cluster.v1beta1.Cluster.State.forNumber(state_); + return result == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.State.UNRECOGNIZED + : result; + } + + public static final int UID_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.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. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.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 REPLICA_COUNT_FIELD_NUMBER = 8; + private int replicaCount_ = 0; + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + @java.lang.Override + public boolean hasReplicaCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + @java.lang.Override + public int getReplicaCount() { + return replicaCount_; + } + + public static final int AUTHORIZATION_MODE_FIELD_NUMBER = 11; + private int authorizationMode_ = 0; + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.AuthorizationMode getAuthorizationMode() { + com.google.cloud.redis.cluster.v1beta1.AuthorizationMode result = + com.google.cloud.redis.cluster.v1beta1.AuthorizationMode.forNumber(authorizationMode_); + return result == null + ? com.google.cloud.redis.cluster.v1beta1.AuthorizationMode.UNRECOGNIZED + : result; + } + + public static final int TRANSIT_ENCRYPTION_MODE_FIELD_NUMBER = 12; + private int transitEncryptionMode_ = 0; + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode getTransitEncryptionMode() { + com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode result = + com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode.forNumber( + transitEncryptionMode_); + return result == null + ? com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode.UNRECOGNIZED + : result; + } + + public static final int SIZE_GB_FIELD_NUMBER = 13; + private int sizeGb_ = 0; + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the sizeGb field is set. + */ + @java.lang.Override + public boolean hasSizeGb() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public int getSizeGb() { + return sizeGb_; + } + + public static final int SHARD_COUNT_FIELD_NUMBER = 14; + private int shardCount_ = 0; + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the shardCount field is set. + */ + @java.lang.Override + public boolean hasShardCount() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + + public static final int PSC_CONFIGS_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private java.util.List pscConfigs_; + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List getPscConfigsList() { + return pscConfigs_; + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public java.util.List + getPscConfigsOrBuilderList() { + return pscConfigs_; + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public int getPscConfigsCount() { + return pscConfigs_.size(); + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfig getPscConfigs(int index) { + return pscConfigs_.get(index); + } + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder getPscConfigsOrBuilder( + int index) { + return pscConfigs_.get(index); + } + + public static final int DISCOVERY_ENDPOINTS_FIELD_NUMBER = 16; + + @SuppressWarnings("serial") + private java.util.List + discoveryEndpoints_; + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsOrBuilderList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDiscoveryEndpointsCount() { + return discoveryEndpoints_.size(); + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint getDiscoveryEndpoints(int index) { + return discoveryEndpoints_.get(index); + } + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder + getDiscoveryEndpointsOrBuilder(int index) { + return discoveryEndpoints_.get(index); + } + + public static final int PSC_CONNECTIONS_FIELD_NUMBER = 17; + + @SuppressWarnings("serial") + private java.util.List pscConnections_; + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPscConnectionsList() { + return pscConnections_; + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getPscConnectionsOrBuilderList() { + return pscConnections_; + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getPscConnectionsCount() { + return pscConnections_.size(); + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConnection getPscConnections(int index) { + return pscConnections_.get(index); + } + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConnectionOrBuilder getPscConnectionsOrBuilder( + int index) { + return pscConnections_.get(index); + } + + public static final int STATE_INFO_FIELD_NUMBER = 18; + private com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo stateInfo_; + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + @java.lang.Override + public boolean hasStateInfo() { + return stateInfo_ != null; + } + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo getStateInfo() { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfoOrBuilder getStateInfoOrBuilder() { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (createTime_ != null) { + output.writeMessage(3, getCreateTime()); + } + if (state_ + != com.google.cloud.redis.cluster.v1beta1.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, uid_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.redis.cluster.v1beta1.AuthorizationMode.AUTH_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(11, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(12, transitEncryptionMode_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(13, sizeGb_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt32(14, shardCount_); + } + for (int i = 0; i < pscConfigs_.size(); i++) { + output.writeMessage(15, pscConfigs_.get(i)); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + output.writeMessage(16, discoveryEndpoints_.get(i)); + } + for (int i = 0; i < pscConnections_.size(); i++) { + output.writeMessage(17, pscConnections_.get(i)); + } + if (stateInfo_ != null) { + output.writeMessage(18, getStateInfo()); + } + 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 (createTime_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getCreateTime()); + } + if (state_ + != com.google.cloud.redis.cluster.v1beta1.Cluster.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, state_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, uid_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.redis.cluster.v1beta1.AuthorizationMode.AUTH_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(11, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(12, transitEncryptionMode_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(13, sizeGb_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(14, shardCount_); + } + for (int i = 0; i < pscConfigs_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(15, pscConfigs_.get(i)); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(16, discoveryEndpoints_.get(i)); + } + for (int i = 0; i < pscConnections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, pscConnections_.get(i)); + } + if (stateInfo_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getStateInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.Cluster)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.Cluster other = + (com.google.cloud.redis.cluster.v1beta1.Cluster) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (state_ != other.state_) return false; + if (!getUid().equals(other.getUid())) return false; + if (hasReplicaCount() != other.hasReplicaCount()) return false; + if (hasReplicaCount()) { + if (getReplicaCount() != other.getReplicaCount()) return false; + } + if (authorizationMode_ != other.authorizationMode_) return false; + if (transitEncryptionMode_ != other.transitEncryptionMode_) return false; + if (hasSizeGb() != other.hasSizeGb()) return false; + if (hasSizeGb()) { + if (getSizeGb() != other.getSizeGb()) return false; + } + if (hasShardCount() != other.hasShardCount()) return false; + if (hasShardCount()) { + if (getShardCount() != other.getShardCount()) return false; + } + if (!getPscConfigsList().equals(other.getPscConfigsList())) return false; + if (!getDiscoveryEndpointsList().equals(other.getDiscoveryEndpointsList())) return false; + if (!getPscConnectionsList().equals(other.getPscConnectionsList())) return false; + if (hasStateInfo() != other.hasStateInfo()) return false; + if (hasStateInfo()) { + if (!getStateInfo().equals(other.getStateInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasCreateTime()) { + hash = (37 * hash) + CREATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getCreateTime().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + hash = (37 * hash) + UID_FIELD_NUMBER; + hash = (53 * hash) + getUid().hashCode(); + if (hasReplicaCount()) { + hash = (37 * hash) + REPLICA_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getReplicaCount(); + } + hash = (37 * hash) + AUTHORIZATION_MODE_FIELD_NUMBER; + hash = (53 * hash) + authorizationMode_; + hash = (37 * hash) + TRANSIT_ENCRYPTION_MODE_FIELD_NUMBER; + hash = (53 * hash) + transitEncryptionMode_; + if (hasSizeGb()) { + hash = (37 * hash) + SIZE_GB_FIELD_NUMBER; + hash = (53 * hash) + getSizeGb(); + } + if (hasShardCount()) { + hash = (37 * hash) + SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getShardCount(); + } + if (getPscConfigsCount() > 0) { + hash = (37 * hash) + PSC_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + getPscConfigsList().hashCode(); + } + if (getDiscoveryEndpointsCount() > 0) { + hash = (37 * hash) + DISCOVERY_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getDiscoveryEndpointsList().hashCode(); + } + if (getPscConnectionsCount() > 0) { + hash = (37 * hash) + PSC_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscConnectionsList().hashCode(); + } + if (hasStateInfo()) { + hash = (37 * hash) + STATE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getStateInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.Cluster parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.Cluster parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.Cluster parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.Cluster parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.Cluster parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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 instance.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.Cluster} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.Cluster) + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.Cluster.class, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.Cluster.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + state_ = 0; + uid_ = ""; + replicaCount_ = 0; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + sizeGb_ = 0; + shardCount_ = 0; + if (pscConfigsBuilder_ == null) { + pscConfigs_ = java.util.Collections.emptyList(); + } else { + pscConfigs_ = null; + pscConfigsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000200); + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + } else { + discoveryEndpoints_ = null; + discoveryEndpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000400); + if (pscConnectionsBuilder_ == null) { + pscConnections_ = java.util.Collections.emptyList(); + } else { + pscConnections_ = null; + pscConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_Cluster_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster build() { + com.google.cloud.redis.cluster.v1beta1.Cluster result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster buildPartial() { + com.google.cloud.redis.cluster.v1beta1.Cluster result = + new com.google.cloud.redis.cluster.v1beta1.Cluster(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.redis.cluster.v1beta1.Cluster result) { + if (pscConfigsBuilder_ == null) { + if (((bitField0_ & 0x00000200) != 0)) { + pscConfigs_ = java.util.Collections.unmodifiableList(pscConfigs_); + bitField0_ = (bitField0_ & ~0x00000200); + } + result.pscConfigs_ = pscConfigs_; + } else { + result.pscConfigs_ = pscConfigsBuilder_.build(); + } + if (discoveryEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000400) != 0)) { + discoveryEndpoints_ = java.util.Collections.unmodifiableList(discoveryEndpoints_); + bitField0_ = (bitField0_ & ~0x00000400); + } + result.discoveryEndpoints_ = discoveryEndpoints_; + } else { + result.discoveryEndpoints_ = discoveryEndpointsBuilder_.build(); + } + if (pscConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + pscConnections_ = java.util.Collections.unmodifiableList(pscConnections_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.pscConnections_ = pscConnections_; + } else { + result.pscConnections_ = pscConnectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.Cluster result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.uid_ = uid_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.replicaCount_ = replicaCount_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.authorizationMode_ = authorizationMode_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.transitEncryptionMode_ = transitEncryptionMode_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.sizeGb_ = sizeGb_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.shardCount_ = shardCount_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.stateInfo_ = stateInfoBuilder_ == null ? stateInfo_ : stateInfoBuilder_.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.redis.cluster.v1beta1.Cluster) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.Cluster) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.Cluster other) { + if (other == com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (other.hasReplicaCount()) { + setReplicaCount(other.getReplicaCount()); + } + if (other.authorizationMode_ != 0) { + setAuthorizationModeValue(other.getAuthorizationModeValue()); + } + if (other.transitEncryptionMode_ != 0) { + setTransitEncryptionModeValue(other.getTransitEncryptionModeValue()); + } + if (other.hasSizeGb()) { + setSizeGb(other.getSizeGb()); + } + if (other.hasShardCount()) { + setShardCount(other.getShardCount()); + } + if (pscConfigsBuilder_ == null) { + if (!other.pscConfigs_.isEmpty()) { + if (pscConfigs_.isEmpty()) { + pscConfigs_ = other.pscConfigs_; + bitField0_ = (bitField0_ & ~0x00000200); + } else { + ensurePscConfigsIsMutable(); + pscConfigs_.addAll(other.pscConfigs_); + } + onChanged(); + } + } else { + if (!other.pscConfigs_.isEmpty()) { + if (pscConfigsBuilder_.isEmpty()) { + pscConfigsBuilder_.dispose(); + pscConfigsBuilder_ = null; + pscConfigs_ = other.pscConfigs_; + bitField0_ = (bitField0_ & ~0x00000200); + pscConfigsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPscConfigsFieldBuilder() + : null; + } else { + pscConfigsBuilder_.addAllMessages(other.pscConfigs_); + } + } + } + if (discoveryEndpointsBuilder_ == null) { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpoints_.isEmpty()) { + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000400); + } else { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.addAll(other.discoveryEndpoints_); + } + onChanged(); + } + } else { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpointsBuilder_.isEmpty()) { + discoveryEndpointsBuilder_.dispose(); + discoveryEndpointsBuilder_ = null; + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000400); + discoveryEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDiscoveryEndpointsFieldBuilder() + : null; + } else { + discoveryEndpointsBuilder_.addAllMessages(other.discoveryEndpoints_); + } + } + } + if (pscConnectionsBuilder_ == null) { + if (!other.pscConnections_.isEmpty()) { + if (pscConnections_.isEmpty()) { + pscConnections_ = other.pscConnections_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensurePscConnectionsIsMutable(); + pscConnections_.addAll(other.pscConnections_); + } + onChanged(); + } + } else { + if (!other.pscConnections_.isEmpty()) { + if (pscConnectionsBuilder_.isEmpty()) { + pscConnectionsBuilder_.dispose(); + pscConnectionsBuilder_ = null; + pscConnections_ = other.pscConnections_; + bitField0_ = (bitField0_ & ~0x00000800); + pscConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPscConnectionsFieldBuilder() + : null; + } else { + pscConnectionsBuilder_.addAllMessages(other.pscConnections_); + } + } + } + if (other.hasStateInfo()) { + mergeStateInfo(other.getStateInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 26: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 26 + case 32: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 32 + case 42: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 42 + case 64: + { + replicaCount_ = input.readInt32(); + bitField0_ |= 0x00000010; + break; + } // case 64 + case 88: + { + authorizationMode_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 88 + case 96: + { + transitEncryptionMode_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 96 + case 104: + { + sizeGb_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 104 + case 112: + { + shardCount_ = input.readInt32(); + bitField0_ |= 0x00000100; + break; + } // case 112 + case 122: + { + com.google.cloud.redis.cluster.v1beta1.PscConfig m = + input.readMessage( + com.google.cloud.redis.cluster.v1beta1.PscConfig.parser(), + extensionRegistry); + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.add(m); + } else { + pscConfigsBuilder_.addMessage(m); + } + break; + } // case 122 + case 130: + { + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint m = + input.readMessage( + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.parser(), + extensionRegistry); + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(m); + } else { + discoveryEndpointsBuilder_.addMessage(m); + } + break; + } // case 130 + case 138: + { + com.google.cloud.redis.cluster.v1beta1.PscConnection m = + input.readMessage( + com.google.cloud.redis.cluster.v1beta1.PscConnection.parser(), + extensionRegistry); + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.add(m); + } else { + pscConnectionsBuilder_.addMessage(m); + } + break; + } // case 138 + case 146: + { + input.readMessage(getStateInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00001000; + break; + } // case 146 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Unique name of the resource in this scope including project and
+     * location using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + 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. The timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. The timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. The timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.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 timestamp associated with the cluster creation request.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.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 this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.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_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster.State getState() { + com.google.cloud.redis.cluster.v1beta1.Cluster.State result = + com.google.cloud.redis.cluster.v1beta1.Cluster.State.forNumber(state_); + return result == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.redis.cluster.v1beta1.Cluster.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The current state of this cluster.
+     * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000004); + state_ = 0; + onChanged(); + return this; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the cluster.
+     * 
+ * + * string uid = 5 [(.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_ |= 0x00000008; + onChanged(); + return this; + } + + private int replicaCount_; + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + @java.lang.Override + public boolean hasReplicaCount() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + @java.lang.Override + public int getReplicaCount() { + return replicaCount_; + } + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The replicaCount to set. + * @return This builder for chaining. + */ + public Builder setReplicaCount(int value) { + + replicaCount_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The number of replica nodes per shard.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000010); + replicaCount_ = 0; + onChanged(); + return this; + } + + private int authorizationMode_ = 0; + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for authorizationMode to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationModeValue(int value) { + authorizationMode_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.AuthorizationMode getAuthorizationMode() { + com.google.cloud.redis.cluster.v1beta1.AuthorizationMode result = + com.google.cloud.redis.cluster.v1beta1.AuthorizationMode.forNumber(authorizationMode_); + return result == null + ? com.google.cloud.redis.cluster.v1beta1.AuthorizationMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The authorizationMode to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationMode( + com.google.cloud.redis.cluster.v1beta1.AuthorizationMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + authorizationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The authorization mode of the Redis cluster.
+     * If not provided, auth feature is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizationMode() { + bitField0_ = (bitField0_ & ~0x00000020); + authorizationMode_ = 0; + onChanged(); + return this; + } + + private int transitEncryptionMode_ = 0; + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for transitEncryptionMode to set. + * @return This builder for chaining. + */ + public Builder setTransitEncryptionModeValue(int value) { + transitEncryptionMode_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode getTransitEncryptionMode() { + com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode result = + com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode.forNumber( + transitEncryptionMode_); + return result == null + ? com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The transitEncryptionMode to set. + * @return This builder for chaining. + */ + public Builder setTransitEncryptionMode( + com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + transitEncryptionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The in-transit encryption for the Redis cluster.
+     * If not provided, encryption  is disabled for the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransitEncryptionMode() { + bitField0_ = (bitField0_ & ~0x00000040); + transitEncryptionMode_ = 0; + onChanged(); + return this; + } + + private int sizeGb_; + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the sizeGb field is set. + */ + @java.lang.Override + public boolean hasSizeGb() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public int getSizeGb() { + return sizeGb_; + } + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeGb to set. + * @return This builder for chaining. + */ + public Builder setSizeGb(int value) { + + sizeGb_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Redis memory size in GB for the entire cluster.
+     * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeGb() { + bitField0_ = (bitField0_ & ~0x00000080); + sizeGb_ = 0; + onChanged(); + return this; + } + + private int shardCount_; + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the shardCount field is set. + */ + @java.lang.Override + public boolean hasShardCount() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The shardCount to set. + * @return This builder for chaining. + */ + public Builder setShardCount(int value) { + + shardCount_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Number of shards for the Redis cluster.
+     * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearShardCount() { + bitField0_ = (bitField0_ & ~0x00000100); + shardCount_ = 0; + onChanged(); + return this; + } + + private java.util.List pscConfigs_ = + java.util.Collections.emptyList(); + + private void ensurePscConfigsIsMutable() { + if (!((bitField0_ & 0x00000200) != 0)) { + pscConfigs_ = + new java.util.ArrayList(pscConfigs_); + bitField0_ |= 0x00000200; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConfig, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder> + pscConfigsBuilder_; + + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List getPscConfigsList() { + if (pscConfigsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscConfigs_); + } else { + return pscConfigsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public int getPscConfigsCount() { + if (pscConfigsBuilder_ == null) { + return pscConfigs_.size(); + } else { + return pscConfigsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfig getPscConfigs(int index) { + if (pscConfigsBuilder_ == null) { + return pscConfigs_.get(index); + } else { + return pscConfigsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPscConfigs( + int index, com.google.cloud.redis.cluster.v1beta1.PscConfig value) { + if (pscConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConfigsIsMutable(); + pscConfigs_.set(index, value); + onChanged(); + } else { + pscConfigsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setPscConfigs( + int index, com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder builderForValue) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.set(index, builderForValue.build()); + onChanged(); + } else { + pscConfigsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs(com.google.cloud.redis.cluster.v1beta1.PscConfig value) { + if (pscConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConfigsIsMutable(); + pscConfigs_.add(value); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs( + int index, com.google.cloud.redis.cluster.v1beta1.PscConfig value) { + if (pscConfigsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConfigsIsMutable(); + pscConfigs_.add(index, value); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs( + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder builderForValue) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.add(builderForValue.build()); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addPscConfigs( + int index, com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder builderForValue) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.add(index, builderForValue.build()); + onChanged(); + } else { + pscConfigsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder addAllPscConfigs( + java.lang.Iterable values) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pscConfigs_); + onChanged(); + } else { + pscConfigsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearPscConfigs() { + if (pscConfigsBuilder_ == null) { + pscConfigs_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000200); + onChanged(); + } else { + pscConfigsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder removePscConfigs(int index) { + if (pscConfigsBuilder_ == null) { + ensurePscConfigsIsMutable(); + pscConfigs_.remove(index); + onChanged(); + } else { + pscConfigsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder getPscConfigsBuilder( + int index) { + return getPscConfigsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder getPscConfigsOrBuilder( + int index) { + if (pscConfigsBuilder_ == null) { + return pscConfigs_.get(index); + } else { + return pscConfigsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPscConfigsOrBuilderList() { + if (pscConfigsBuilder_ != null) { + return pscConfigsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscConfigs_); + } + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder addPscConfigsBuilder() { + return getPscConfigsFieldBuilder() + .addBuilder(com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder addPscConfigsBuilder( + int index) { + return getPscConfigsFieldBuilder() + .addBuilder(index, com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Each PscConfig configures the consumer network where IPs will
+     * be designated to the cluster for client access through Private Service
+     * Connect Automation. Currently, only one PscConfig is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public java.util.List + getPscConfigsBuilderList() { + return getPscConfigsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConfig, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder> + getPscConfigsFieldBuilder() { + if (pscConfigsBuilder_ == null) { + pscConfigsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConfig, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder>( + pscConfigs_, ((bitField0_ & 0x00000200) != 0), getParentForChildren(), isClean()); + pscConfigs_ = null; + } + return pscConfigsBuilder_; + } + + private java.util.List + discoveryEndpoints_ = java.util.Collections.emptyList(); + + private void ensureDiscoveryEndpointsIsMutable() { + if (!((bitField0_ & 0x00000400) != 0)) { + discoveryEndpoints_ = + new java.util.ArrayList( + discoveryEndpoints_); + bitField0_ |= 0x00000400; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder> + discoveryEndpointsBuilder_; + + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDiscoveryEndpointsList() { + if (discoveryEndpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(discoveryEndpoints_); + } else { + return discoveryEndpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDiscoveryEndpointsCount() { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.size(); + } else { + return discoveryEndpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint getDiscoveryEndpoints( + int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint value) { + if (discoveryEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.set(index, value); + onChanged(); + } else { + discoveryEndpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint value) { + if (discoveryEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(value); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint value) { + if (discoveryEndpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(index, value); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllDiscoveryEndpoints( + java.lang.Iterable + values) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, discoveryEndpoints_); + onChanged(); + } else { + discoveryEndpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDiscoveryEndpoints() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000400); + onChanged(); + } else { + discoveryEndpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removeDiscoveryEndpoints(int index) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.remove(index); + onChanged(); + } else { + discoveryEndpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder + getDiscoveryEndpointsBuilder(int index) { + return getDiscoveryEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder + getDiscoveryEndpointsOrBuilder(int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List< + ? extends com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder> + getDiscoveryEndpointsOrBuilderList() { + if (discoveryEndpointsBuilder_ != null) { + return discoveryEndpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(discoveryEndpoints_); + } + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder + addDiscoveryEndpointsBuilder() { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder( + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder + addDiscoveryEndpointsBuilder(int index) { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder( + index, com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints created on each given network, for Redis clients to
+     * connect to the cluster. Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDiscoveryEndpointsBuilderList() { + return getDiscoveryEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder> + getDiscoveryEndpointsFieldBuilder() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder>( + discoveryEndpoints_, + ((bitField0_ & 0x00000400) != 0), + getParentForChildren(), + isClean()); + discoveryEndpoints_ = null; + } + return discoveryEndpointsBuilder_; + } + + private java.util.List pscConnections_ = + java.util.Collections.emptyList(); + + private void ensurePscConnectionsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + pscConnections_ = + new java.util.ArrayList( + pscConnections_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConnection, + com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConnectionOrBuilder> + pscConnectionsBuilder_; + + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscConnectionsList() { + if (pscConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscConnections_); + } else { + return pscConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getPscConnectionsCount() { + if (pscConnectionsBuilder_ == null) { + return pscConnections_.size(); + } else { + return pscConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConnection getPscConnections(int index) { + if (pscConnectionsBuilder_ == null) { + return pscConnections_.get(index); + } else { + return pscConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConnections( + int index, com.google.cloud.redis.cluster.v1beta1.PscConnection value) { + if (pscConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConnectionsIsMutable(); + pscConnections_.set(index, value); + onChanged(); + } else { + pscConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConnections( + int index, com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder builderForValue) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections(com.google.cloud.redis.cluster.v1beta1.PscConnection value) { + if (pscConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConnectionsIsMutable(); + pscConnections_.add(value); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections( + int index, com.google.cloud.redis.cluster.v1beta1.PscConnection value) { + if (pscConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscConnectionsIsMutable(); + pscConnections_.add(index, value); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections( + com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder builderForValue) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addPscConnections( + int index, com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder builderForValue) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addAllPscConnections( + java.lang.Iterable values) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pscConnections_); + onChanged(); + } else { + pscConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPscConnections() { + if (pscConnectionsBuilder_ == null) { + pscConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + pscConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder removePscConnections(int index) { + if (pscConnectionsBuilder_ == null) { + ensurePscConnectionsIsMutable(); + pscConnections_.remove(index); + onChanged(); + } else { + pscConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder getPscConnectionsBuilder( + int index) { + return getPscConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConnectionOrBuilder getPscConnectionsOrBuilder( + int index) { + if (pscConnectionsBuilder_ == null) { + return pscConnections_.get(index); + } else { + return pscConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscConnectionsOrBuilderList() { + if (pscConnectionsBuilder_ != null) { + return pscConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscConnections_); + } + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder addPscConnectionsBuilder() { + return getPscConnectionsFieldBuilder() + .addBuilder(com.google.cloud.redis.cluster.v1beta1.PscConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder addPscConnectionsBuilder( + int index) { + return getPscConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.redis.cluster.v1beta1.PscConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. PSC connections for discovery of the cluster topology and
+     * accessing the cluster.
+     * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getPscConnectionsBuilderList() { + return getPscConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConnection, + com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConnectionOrBuilder> + getPscConnectionsFieldBuilder() { + if (pscConnectionsBuilder_ == null) { + pscConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConnection, + com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConnectionOrBuilder>( + pscConnections_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + pscConnections_ = null; + } + return pscConnectionsBuilder_; + } + + private com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo stateInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.Builder, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfoOrBuilder> + stateInfoBuilder_; + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + public boolean hasStateInfo() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo getStateInfo() { + if (stateInfoBuilder_ == null) { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } else { + return stateInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo(com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateInfo_ = value; + } else { + stateInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo( + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.Builder builderForValue) { + if (stateInfoBuilder_ == null) { + stateInfo_ = builderForValue.build(); + } else { + stateInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStateInfo(com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (((bitField0_ & 0x00001000) != 0) + && stateInfo_ != null + && stateInfo_ + != com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.getDefaultInstance()) { + getStateInfoBuilder().mergeFrom(value); + } else { + stateInfo_ = value; + } + } else { + stateInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateInfo() { + bitField0_ = (bitField0_ & ~0x00001000); + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.Builder getStateInfoBuilder() { + bitField0_ |= 0x00001000; + onChanged(); + return getStateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfoOrBuilder + getStateInfoOrBuilder() { + if (stateInfoBuilder_ != null) { + return stateInfoBuilder_.getMessageOrBuilder(); + } else { + return stateInfo_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.getDefaultInstance() + : stateInfo_; + } + } + /** + * + * + *
+     * Output only. Additional information about the current state of the cluster.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.Builder, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfoOrBuilder> + getStateInfoFieldBuilder() { + if (stateInfoBuilder_ == null) { + stateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo.Builder, + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfoOrBuilder>( + getStateInfo(), getParentForChildren(), isClean()); + stateInfo_ = null; + } + return stateInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1beta1.Cluster) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.Cluster) + private static final com.google.cloud.redis.cluster.v1beta1.Cluster DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.Cluster(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.Cluster getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ClusterName.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ClusterName.java new file mode 100644 index 000000000000..7641489e13df --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ClusterName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +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-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ClusterOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ClusterOrBuilder.java new file mode 100644 index 000000000000..6001f7f69efc --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ClusterOrBuilder.java @@ -0,0 +1,535 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface ClusterOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.Cluster) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Unique name of the resource in this scope including project and
+   * location using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. The timestamp associated with the cluster creation request.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. The current state of this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. The current state of this cluster.
+   * Can be CREATING, READY, UPDATING, DELETING and SUSPENDED
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.State state = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.redis.cluster.v1beta1.Cluster.State getState(); + + /** + * + * + *
+   * Output only. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. System assigned, unique identifier for the cluster.
+   * 
+ * + * string uid = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + boolean hasReplicaCount(); + /** + * + * + *
+   * Optional. The number of replica nodes per shard.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + int getReplicaCount(); + + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + int getAuthorizationModeValue(); + /** + * + * + *
+   * Optional. The authorization mode of the Redis cluster.
+   * If not provided, auth feature is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.AuthorizationMode authorization_mode = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The authorizationMode. + */ + com.google.cloud.redis.cluster.v1beta1.AuthorizationMode getAuthorizationMode(); + + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + int getTransitEncryptionModeValue(); + /** + * + * + *
+   * Optional. The in-transit encryption for the Redis cluster.
+   * If not provided, encryption  is disabled for the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.TransitEncryptionMode transit_encryption_mode = 12 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The transitEncryptionMode. + */ + com.google.cloud.redis.cluster.v1beta1.TransitEncryptionMode getTransitEncryptionMode(); + + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return Whether the sizeGb field is set. + */ + boolean hasSizeGb(); + /** + * + * + *
+   * Output only. Redis memory size in GB for the entire cluster.
+   * 
+ * + * optional int32 size_gb = 13 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + int getSizeGb(); + + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return Whether the shardCount field is set. + */ + boolean hasShardCount(); + /** + * + * + *
+   * Required. Number of shards for the Redis cluster.
+   * 
+ * + * optional int32 shard_count = 14 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The shardCount. + */ + int getShardCount(); + + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List getPscConfigsList(); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1beta1.PscConfig getPscConfigs(int index); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + int getPscConfigsCount(); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + java.util.List + getPscConfigsOrBuilderList(); + /** + * + * + *
+   * Required. Each PscConfig configures the consumer network where IPs will
+   * be designated to the cluster for client access through Private Service
+   * Connect Automation. Currently, only one PscConfig is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConfig psc_configs = 15 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder getPscConfigsOrBuilder(int index); + + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDiscoveryEndpointsList(); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint getDiscoveryEndpoints(int index); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDiscoveryEndpointsCount(); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDiscoveryEndpointsOrBuilderList(); + /** + * + * + *
+   * Output only. Endpoints created on each given network, for Redis clients to
+   * connect to the cluster. Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint discovery_endpoints = 16 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder getDiscoveryEndpointsOrBuilder( + int index); + + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getPscConnectionsList(); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1beta1.PscConnection getPscConnections(int index); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getPscConnectionsCount(); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getPscConnectionsOrBuilderList(); + /** + * + * + *
+   * Output only. PSC connections for discovery of the cluster topology and
+   * accessing the cluster.
+   * 
+ * + * + * repeated .google.cloud.redis.cluster.v1beta1.PscConnection psc_connections = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1beta1.PscConnectionOrBuilder getPscConnectionsOrBuilder( + int index); + + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + boolean hasStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfo getStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the current state of the cluster.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster.StateInfo state_info = 18 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1beta1.Cluster.StateInfoOrBuilder getStateInfoOrBuilder(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CreateClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CreateClusterRequest.java new file mode 100644 index 000000000000..5a6b21bd99fa --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CreateClusterRequest.java @@ -0,0 +1,1355 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Request for [CreateCluster][CloudRedis.CreateCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.CreateClusterRequest} + */ +public final class CreateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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 resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * 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.redis.cluster.v1beta1.Cluster cluster_; + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.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 cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @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; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @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(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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest other = + (com.google.cloud.redis.cluster.v1beta1.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 (!getUnknownFields().equals(other.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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.CreateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.CreateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.CreateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.CreateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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; + } + /** + * + * + *
+   * Request for [CreateCluster][CloudRedis.CreateCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.CreateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.CreateClusterRequest) + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_CreateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_CreateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest build() { + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest result = + new com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.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_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest other) { + if (other == com.google.cloud.redis.cluster.v1beta1.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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. The logical name of the Redis cluster in the customer project
+     * with the following restrictions:
+     *
+     * * Must contain only lowercase letters, numbers, and hyphens.
+     * * Must start with a letter.
+     * * Must be between 1-63 characters.
+     * * Must end with a number or a letter.
+     * * Must be unique within the customer project / location
+     * 
+ * + * 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.redis.cluster.v1beta1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.redis.cluster.v1beta1.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster( + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.redis.cluster.v1beta1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.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 cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. The cluster that is to be created.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 4; + * + * @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; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1beta1.CreateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.CreateClusterRequest) + private static final com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.CreateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CreateClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CreateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..ad31fca6293e --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/CreateClusterRequestOrBuilder.java @@ -0,0 +1,163 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface CreateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.CreateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The clusterId. + */ + java.lang.String getClusterId(); + /** + * + * + *
+   * Required. The logical name of the Redis cluster in the customer project
+   * with the following restrictions:
+   *
+   * * Must contain only lowercase letters, numbers, and hyphens.
+   * * Must start with a letter.
+   * * Must be between 1-63 characters.
+   * * Must end with a number or a letter.
+   * * Must be unique within the customer project / location
+   * 
+ * + * string cluster_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for clusterId. + */ + com.google.protobuf.ByteString getClusterIdBytes(); + + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.redis.cluster.v1beta1.Cluster getCluster(); + /** + * + * + *
+   * Required. The cluster that is to be created.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 4; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DeleteClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DeleteClusterRequest.java new file mode 100644 index 000000000000..78b31ff355cc --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DeleteClusterRequest.java @@ -0,0 +1,835 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Request for [DeleteCluster][CloudRedis.DeleteCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.DeleteClusterRequest} + */ +public final class DeleteClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteClusterRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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_ = ""; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @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; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @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(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + 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(name_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + 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.redis.cluster.v1beta1.DeleteClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest other = + (com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest) obj; + + if (!getName().equals(other.getName())) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().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.redis.cluster.v1beta1.DeleteClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.DeleteClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.DeleteClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.DeleteClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.DeleteClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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; + } + /** + * + * + *
+   * Request for [DeleteCluster][CloudRedis.DeleteCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.DeleteClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.DeleteClusterRequest) + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DeleteClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DeleteClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest build() { + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest result = + new com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + 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.redis.cluster.v1beta1.DeleteClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest other) { + if (other == com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + 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: + { + name_ = 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 name_ = ""; + /** + * + * + *
+     * Required. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 2; + * + * @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.redis.cluster.v1beta1.DeleteClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.DeleteClusterRequest) + private static final com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.DeleteClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DeleteClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DeleteClusterRequestOrBuilder.java new file mode 100644 index 000000000000..6a8544e3d600 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DeleteClusterRequestOrBuilder.java @@ -0,0 +1,83 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface DeleteClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.DeleteClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 2; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DiscoveryEndpoint.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DiscoveryEndpoint.java new file mode 100644 index 000000000000..ea26e2cd36db --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DiscoveryEndpoint.java @@ -0,0 +1,1027 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Endpoints on each network, for Redis clients to connect to the cluster.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint} + */ +public final class DiscoveryEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint) + DiscoveryEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use DiscoveryEndpoint.newBuilder() to construct. + private DiscoveryEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DiscoveryEndpoint() { + address_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DiscoveryEndpoint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.class, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder.class); + } + + public static final int ADDRESS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object address_ = ""; + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + @java.lang.Override + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PORT_FIELD_NUMBER = 2; + private int port_ = 0; + /** + * + * + *
+   * Output only. The port number of the exposed Redis endpoint.
+   * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + public static final int PSC_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.redis.cluster.v1beta1.PscConfig pscConfig_; + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscConfig field is set. + */ + @java.lang.Override + public boolean hasPscConfig() { + return pscConfig_ != null; + } + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConfig. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfig getPscConfig() { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance() + : pscConfig_; + } + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder getPscConfigOrBuilder() { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance() + : pscConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(address_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, address_); + } + if (port_ != 0) { + output.writeInt32(2, port_); + } + if (pscConfig_ != null) { + output.writeMessage(3, getPscConfig()); + } + 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(address_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, address_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, port_); + } + if (pscConfig_ != null) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getPscConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint other = + (com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint) obj; + + if (!getAddress().equals(other.getAddress())) return false; + if (getPort() != other.getPort()) return false; + if (hasPscConfig() != other.hasPscConfig()) return false; + if (hasPscConfig()) { + if (!getPscConfig().equals(other.getPscConfig())) 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) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + if (hasPscConfig()) { + hash = (37 * hash) + PSC_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPscConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Endpoints on each network, for Redis clients to connect to the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint) + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.class, + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + address_ = ""; + port_ = 0; + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint build() { + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint buildPartial() { + com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint result = + new com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.address_ = address_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.port_ = port_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pscConfig_ = pscConfigBuilder_ == null ? pscConfig_ : pscConfigBuilder_.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.redis.cluster.v1beta1.DiscoveryEndpoint) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint other) { + if (other == com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint.getDefaultInstance()) + return this; + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + if (other.hasPscConfig()) { + mergePscConfig(other.getPscConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + port_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + input.readMessage(getPscConfigFieldBuilder().getBuilder(), extensionRegistry); + 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 address_ = ""; + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + address_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAddress() { + address_ = getDefaultInstance().getAddress(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Address of the exposed Redis endpoint used by clients to
+     * connect to the service. The address could be either IP or hostname.
+     * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for address to set. + * @return This builder for chaining. + */ + public Builder setAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + address_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int port_; + /** + * + * + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + /** + * + * + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The port number of the exposed Redis endpoint.
+     * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000002); + port_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.redis.cluster.v1beta1.PscConfig pscConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConfig, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder> + pscConfigBuilder_; + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscConfig field is set. + */ + public boolean hasPscConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConfig. + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfig getPscConfig() { + if (pscConfigBuilder_ == null) { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance() + : pscConfig_; + } else { + return pscConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConfig(com.google.cloud.redis.cluster.v1beta1.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pscConfig_ = value; + } else { + pscConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setPscConfig( + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder builderForValue) { + if (pscConfigBuilder_ == null) { + pscConfig_ = builderForValue.build(); + } else { + pscConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergePscConfig(com.google.cloud.redis.cluster.v1beta1.PscConfig value) { + if (pscConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && pscConfig_ != null + && pscConfig_ + != com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance()) { + getPscConfigBuilder().mergeFrom(value); + } else { + pscConfig_ = value; + } + } else { + pscConfigBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearPscConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + pscConfig_ = null; + if (pscConfigBuilder_ != null) { + pscConfigBuilder_.dispose(); + pscConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder getPscConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getPscConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder getPscConfigOrBuilder() { + if (pscConfigBuilder_ != null) { + return pscConfigBuilder_.getMessageOrBuilder(); + } else { + return pscConfig_ == null + ? com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance() + : pscConfig_; + } + } + /** + * + * + *
+     * Output only. Customer configuration for where the endpoint is created and
+     * accessed from.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConfig, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder> + getPscConfigFieldBuilder() { + if (pscConfigBuilder_ == null) { + pscConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.PscConfig, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder, + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder>( + getPscConfig(), getParentForChildren(), isClean()); + pscConfig_ = null; + } + return pscConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint) + private static final com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint(); + } + + public static com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DiscoveryEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DiscoveryEndpointOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DiscoveryEndpointOrBuilder.java new file mode 100644 index 000000000000..5e354a5980f6 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/DiscoveryEndpointOrBuilder.java @@ -0,0 +1,109 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface DiscoveryEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.DiscoveryEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + java.lang.String getAddress(); + /** + * + * + *
+   * Output only. Address of the exposed Redis endpoint used by clients to
+   * connect to the service. The address could be either IP or hostname.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + com.google.protobuf.ByteString getAddressBytes(); + + /** + * + * + *
+   * Output only. The port number of the exposed Redis endpoint.
+   * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + int getPort(); + + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the pscConfig field is set. + */ + boolean hasPscConfig(); + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConfig. + */ + com.google.cloud.redis.cluster.v1beta1.PscConfig getPscConfig(); + /** + * + * + *
+   * Output only. Customer configuration for where the endpoint is created and
+   * accessed from.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.PscConfig psc_config = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder getPscConfigOrBuilder(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/GetClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/GetClusterRequest.java new file mode 100644 index 000000000000..1b47ac0a0ff3 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/GetClusterRequest.java @@ -0,0 +1,653 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Request for [GetCluster][CloudRedis.GetCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.GetClusterRequest} + */ +public final class GetClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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.redis.cluster.v1beta1.GetClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest other = + (com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.GetClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.GetClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.GetClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.GetClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.GetClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.GetClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.GetClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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; + } + /** + * + * + *
+   * Request for [GetCluster][CloudRedis.GetCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.GetClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.GetClusterRequest) + com.google.cloud.redis.cluster.v1beta1.GetClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_GetClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_GetClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_GetClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.GetClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.GetClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.GetClusterRequest build() { + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.GetClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1beta1.GetClusterRequest result = + new com.google.cloud.redis.cluster.v1beta1.GetClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.GetClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.GetClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.GetClusterRequest other) { + if (other == com.google.cloud.redis.cluster.v1beta1.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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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. Redis cluster resource name using the form:
+     *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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.redis.cluster.v1beta1.GetClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.GetClusterRequest) + private static final com.google.cloud.redis.cluster.v1beta1.GetClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.GetClusterRequest(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.GetClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/GetClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/GetClusterRequestOrBuilder.java new file mode 100644 index 000000000000..3db9de07d590 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/GetClusterRequestOrBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface GetClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.GetClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. Redis cluster resource name using the form:
+   *     `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersRequest.java new file mode 100644 index 000000000000..967a1c178a64 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersRequest.java @@ -0,0 +1,959 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Request for [ListClusters][CloudRedis.ListClusters].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.ListClustersRequest} + */ +public final class ListClustersRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest.class, + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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 resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * 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; + /** + * + * + *
+   * The maximum number of items to return.
+   *
+   * If not specified, a default value of 1000 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [`next_page_token`][google.cloud.redis.cluster.v1beta1.ListClustersResponse.next_page_token]
+   * to determine if there are more clusters left to be queried.
+   * 
+ * + * 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_ = ""; + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * 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.redis.cluster.v1beta1.ListClustersRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest other = + (com.google.cloud.redis.cluster.v1beta1.ListClustersRequest) 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.redis.cluster.v1beta1.ListClustersRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.ListClustersRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.ListClustersRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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; + } + /** + * + * + *
+   * Request for [ListClusters][CloudRedis.ListClusters].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.ListClustersRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.ListClustersRequest) + com.google.cloud.redis.cluster.v1beta1.ListClustersRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest.class, + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ListClustersRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.ListClustersRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ListClustersRequest build() { + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ListClustersRequest buildPartial() { + com.google.cloud.redis.cluster.v1beta1.ListClustersRequest result = + new com.google.cloud.redis.cluster.v1beta1.ListClustersRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.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_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1beta1.ListClustersRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.ListClustersRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.ListClustersRequest other) { + if (other == com.google.cloud.redis.cluster.v1beta1.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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 resource name of the cluster location using the form:
+     *     `projects/{project_id}/locations/{location_id}`
+     * where `location_id` refers to a GCP region.
+     * 
+ * + * + * 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_; + /** + * + * + *
+     * The maximum number of items to return.
+     *
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [`next_page_token`][google.cloud.redis.cluster.v1beta1.ListClustersResponse.next_page_token]
+     * to determine if there are more clusters left to be queried.
+     * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * The maximum number of items to return.
+     *
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [`next_page_token`][google.cloud.redis.cluster.v1beta1.ListClustersResponse.next_page_token]
+     * to determine if there are more clusters left to be queried.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The maximum number of items to return.
+     *
+     * If not specified, a default value of 1000 will be used by the service.
+     * Regardless of the page_size value, the response may include a partial list
+     * and a caller should only rely on response's
+     * [`next_page_token`][google.cloud.redis.cluster.v1beta1.ListClustersResponse.next_page_token]
+     * to determine if there are more clusters left to be queried.
+     * 
+ * + * 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_ = ""; + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * string page_token = 3; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * The `next_page_token` value returned from a previous
+     * [ListClusters][CloudRedis.ListClusters] request, if any.
+     * 
+ * + * 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.redis.cluster.v1beta1.ListClustersRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.ListClustersRequest) + private static final com.google.cloud.redis.cluster.v1beta1.ListClustersRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.ListClustersRequest(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersRequestOrBuilder.java new file mode 100644 index 000000000000..5b19bcae8862 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersRequestOrBuilder.java @@ -0,0 +1,104 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface ListClustersRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.ListClustersRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The resource name of the cluster location using the form:
+   *     `projects/{project_id}/locations/{location_id}`
+   * where `location_id` refers to a GCP region.
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * The maximum number of items to return.
+   *
+   * If not specified, a default value of 1000 will be used by the service.
+   * Regardless of the page_size value, the response may include a partial list
+   * and a caller should only rely on response's
+   * [`next_page_token`][google.cloud.redis.cluster.v1beta1.ListClustersResponse.next_page_token]
+   * to determine if there are more clusters left to be queried.
+   * 
+ * + * int32 page_size = 2; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * The `next_page_token` value returned from a previous
+   * [ListClusters][CloudRedis.ListClusters] request, if any.
+   * 
+ * + * string page_token = 3; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersResponse.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersResponse.java new file mode 100644 index 000000000000..454330359a5a --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersResponse.java @@ -0,0 +1,1634 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Response for [ListClusters][CloudRedis.ListClusters].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.ListClustersResponse} + */ +public final class ListClustersResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListClustersResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse.class, + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse.Builder.class); + } + + public static final int CLUSTERS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List clusters_; + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List getClustersList() { + return clusters_; + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + @java.lang.Override + public java.util.List + getClustersOrBuilderList() { + return clusters_; + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + @java.lang.Override + public int getClustersCount() { + return clusters_.size(); + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster getClusters(int index) { + return clusters_.get(index); + } + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.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_ = ""; + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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; + } + } + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+   * 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.redis.cluster.v1beta1.ListClustersResponse)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse other = + (com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.ListClustersResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.ListClustersResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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; + } + /** + * + * + *
+   * Response for [ListClusters][CloudRedis.ListClusters].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.ListClustersResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.ListClustersResponse) + com.google.cloud.redis.cluster.v1beta1.ListClustersResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse.class, + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.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.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_ListClustersResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ListClustersResponse getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.ListClustersResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ListClustersResponse build() { + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ListClustersResponse buildPartial() { + com.google.cloud.redis.cluster.v1beta1.ListClustersResponse result = + new com.google.cloud.redis.cluster.v1beta1.ListClustersResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.redis.cluster.v1beta1.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(); + } + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.ListClustersResponse result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.nextPageToken_ = nextPageToken_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + unreachable_.makeImmutable(); + result.unreachable_ = unreachable_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1beta1.ListClustersResponse) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.ListClustersResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.ListClustersResponse other) { + if (other == com.google.cloud.redis.cluster.v1beta1.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_ |= 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.redis.cluster.v1beta1.Cluster m = + input.readMessage( + com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder> + clustersBuilder_; + + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public java.util.List getClustersList() { + if (clustersBuilder_ == null) { + return java.util.Collections.unmodifiableList(clusters_); + } else { + return clustersBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public int getClustersCount() { + if (clustersBuilder_ == null) { + return clusters_.size(); + } else { + return clustersBuilder_.getCount(); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster getClusters(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder setClusters(int index, com.google.cloud.redis.cluster.v1beta1.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.set(index, value); + onChanged(); + } else { + clustersBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder setClusters( + int index, com.google.cloud.redis.cluster.v1beta1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.set(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder addClusters(com.google.cloud.redis.cluster.v1beta1.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(value); + onChanged(); + } else { + clustersBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder addClusters(int index, com.google.cloud.redis.cluster.v1beta1.Cluster value) { + if (clustersBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureClustersIsMutable(); + clusters_.add(index, value); + onChanged(); + } else { + clustersBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder addClusters( + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder addClusters( + int index, com.google.cloud.redis.cluster.v1beta1.Cluster.Builder builderForValue) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.add(index, builderForValue.build()); + onChanged(); + } else { + clustersBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.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; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder clearClusters() { + if (clustersBuilder_ == null) { + clusters_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + clustersBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public Builder removeClusters(int index) { + if (clustersBuilder_ == null) { + ensureClustersIsMutable(); + clusters_.remove(index); + onChanged(); + } else { + clustersBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.Builder getClustersBuilder(int index) { + return getClustersFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClustersOrBuilder(int index) { + if (clustersBuilder_ == null) { + return clusters_.get(index); + } else { + return clustersBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public java.util.List + getClustersOrBuilderList() { + if (clustersBuilder_ != null) { + return clustersBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(clusters_); + } + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.Builder addClustersBuilder() { + return getClustersFieldBuilder() + .addBuilder(com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.Builder addClustersBuilder(int index) { + return getClustersFieldBuilder() + .addBuilder(index, com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance()); + } + /** + * + * + *
+     * A list of Redis clusters in the project in the specified location,
+     * or across all locations.
+     *
+     * If the `location_id` in the parent field of the request is "-", all regions
+     * available to the project are queried, and the results aggregated.
+     * If in such an aggregated query a location is unavailable, a placeholder
+     * Redis entry is included in the response with the `name` field set to a
+     * value of the form
+     * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+     * `status` field set to ERROR and `status_message` field set to "location not
+     * available for ListClusters".
+     * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + public java.util.List + getClustersBuilderList() { + return getClustersFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder> + getClustersFieldBuilder() { + if (clustersBuilder_ == null) { + clustersBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder>( + clusters_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + clusters_ = null; + } + return clustersBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Token to retrieve the next page of results, or empty if there are no more
+     * results in the list.
+     * 
+ * + * 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.LazyStringArrayList unreachable_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureUnreachableIsMutable() { + if (!unreachable_.isModifiable()) { + 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() { + unreachable_.makeImmutable(); + 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); + } + /** + * + * + *
+     * 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); + bitField0_ |= 0x00000004; + 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); + bitField0_ |= 0x00000004; + 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_); + bitField0_ |= 0x00000004; + 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.emptyList(); + 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); + 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.redis.cluster.v1beta1.ListClustersResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.ListClustersResponse) + private static final com.google.cloud.redis.cluster.v1beta1.ListClustersResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.ListClustersResponse(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.ListClustersResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersResponseOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersResponseOrBuilder.java new file mode 100644 index 000000000000..2fcd4b2df646 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/ListClustersResponseOrBuilder.java @@ -0,0 +1,205 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface ListClustersResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.ListClustersResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + java.util.List getClustersList(); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + com.google.cloud.redis.cluster.v1beta1.Cluster getClusters(int index); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + int getClustersCount(); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + java.util.List + getClustersOrBuilderList(); + /** + * + * + *
+   * A list of Redis clusters in the project in the specified location,
+   * or across all locations.
+   *
+   * If the `location_id` in the parent field of the request is "-", all regions
+   * available to the project are queried, and the results aggregated.
+   * If in such an aggregated query a location is unavailable, a placeholder
+   * Redis entry is included in the response with the `name` field set to a
+   * value of the form
+   * `projects/{project_id}/locations/{location_id}/clusters/`- and the
+   * `status` field set to ERROR and `status_message` field set to "location not
+   * available for ListClusters".
+   * 
+ * + * repeated .google.cloud.redis.cluster.v1beta1.Cluster clusters = 1; + */ + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClustersOrBuilder(int index); + + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * Token to retrieve the next page of results, or empty if there are no more
+   * results in the list.
+   * 
+ * + * 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-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/LocationName.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/LocationName.java new file mode 100644 index 000000000000..056a09e86dd1 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1; + +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-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/OperationMetadata.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/OperationMetadata.java new file mode 100644 index 000000000000..8da7f9bec83d --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/OperationMetadata.java @@ -0,0 +1,1829 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Pre-defined metadata fields.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.OperationMetadata.class, + com.google.cloud.redis.cluster.v1beta1.OperationMetadata.Builder.class); + } + + 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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.OperationMetadata other = + (com.google.cloud.redis.cluster.v1beta1.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 (!getUnknownFields().equals(other.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(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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; + } + /** + * + * + *
+   * Pre-defined metadata fields.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.OperationMetadata) + com.google.cloud.redis.cluster.v1beta1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.OperationMetadata.class, + com.google.cloud.redis.cluster.v1beta1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.OperationMetadata.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + endTime_ = null; + if (endTimeBuilder_ != null) { + endTimeBuilder_.dispose(); + endTimeBuilder_ = null; + } + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + requestedCancellation_ = false; + apiVersion_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.OperationMetadata build() { + com.google.cloud.redis.cluster.v1beta1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.OperationMetadata buildPartial() { + com.google.cloud.redis.cluster.v1beta1.OperationMetadata result = + new com.google.cloud.redis.cluster.v1beta1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.target_ = target_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.verb_ = verb_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.statusMessage_ = statusMessage_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.requestedCancellation_ = requestedCancellation_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.apiVersion_ = apiVersion_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1beta1.OperationMetadata) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.OperationMetadata other) { + if (other == com.google.cloud.redis.cluster.v1beta1.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getVerb().isEmpty()) { + verb_ = other.verb_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getStatusMessage().isEmpty()) { + statusMessage_ = other.statusMessage_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (other.getRequestedCancellation() != false) { + setRequestedCancellation(other.getRequestedCancellation()); + } + if (!other.getApiVersion().isEmpty()) { + apiVersion_ = other.apiVersion_; + bitField0_ |= 0x00000040; + 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(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getEndTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + target_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + verb_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + statusMessage_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + case 48: + { + requestedCancellation_ = input.readBool(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + apiVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private 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_ & 0x00000001) != 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_ |= 0x00000001; + 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_ |= 0x00000001; + 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_ & 0x00000001) != 0) + && createTime_ != null + && createTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getCreateTimeBuilder().mergeFrom(value); + } else { + createTime_ = value; + } + } else { + createTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000001; + 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_ & ~0x00000001); + 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_ |= 0x00000001; + 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_ & 0x00000002) != 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_ |= 0x00000002; + 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_ |= 0x00000002; + 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_ & 0x00000002) != 0) + && endTime_ != null + && endTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getEndTimeBuilder().mergeFrom(value); + } else { + endTime_ = value; + } + } else { + endTimeBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + 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_ & ~0x00000002); + 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_ |= 0x00000002; + 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_ |= 0x00000004; + 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_ & ~0x00000004); + 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_ |= 0x00000004; + 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_ |= 0x00000008; + 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_ & ~0x00000008); + 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_ |= 0x00000008; + 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_ |= 0x00000010; + 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_ & ~0x00000010); + 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_ |= 0x00000010; + 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_ |= 0x00000020; + 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_ & ~0x00000020); + 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_ |= 0x00000040; + 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_ & ~0x00000040); + 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_ |= 0x00000040; + 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.redis.cluster.v1beta1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.OperationMetadata) + private static final com.google.cloud.redis.cluster.v1beta1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.OperationMetadata(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/OperationMetadataOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..04313b94c8d7 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/OperationMetadataOrBuilder.java @@ -0,0 +1,218 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.OperationMetadata) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * 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(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConfig.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConfig.java new file mode 100644 index 000000000000..d159ff21a589 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConfig.java @@ -0,0 +1,622 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** Protobuf type {@code google.cloud.redis.cluster.v1beta1.PscConfig} */ +public final class PscConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.PscConfig) + PscConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PscConfig.newBuilder() to construct. + private PscConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PscConfig() { + network_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PscConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.PscConfig.class, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder.class); + } + + public static final int NETWORK_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Required. The network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, network_); + } + 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(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, network_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.PscConfig)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.PscConfig other = + (com.google.cloud.redis.cluster.v1beta1.PscConfig) obj; + + if (!getNetwork().equals(other.getNetwork())) 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) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.redis.cluster.v1beta1.PscConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.redis.cluster.v1beta1.PscConfig} */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.PscConfig) + com.google.cloud.redis.cluster.v1beta1.PscConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.PscConfig.class, + com.google.cloud.redis.cluster.v1beta1.PscConfig.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.PscConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + network_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfig getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfig build() { + com.google.cloud.redis.cluster.v1beta1.PscConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfig buildPartial() { + com.google.cloud.redis.cluster.v1beta1.PscConfig result = + new com.google.cloud.redis.cluster.v1beta1.PscConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.PscConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.network_ = network_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1beta1.PscConfig) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.PscConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.PscConfig other) { + if (other == com.google.cloud.redis.cluster.v1beta1.PscConfig.getDefaultInstance()) + return this; + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + 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 18: + { + network_ = 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 network_ = ""; + /** + * + * + *
+     * Required. The network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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 network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the IP address of the discovery endpoint will
+     * be reserved, in the form of
+     * projects/{network_project}/global/networks/{network_id}.
+     * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 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.redis.cluster.v1beta1.PscConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.PscConfig) + private static final com.google.cloud.redis.cluster.v1beta1.PscConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.PscConfig(); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConfigOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConfigOrBuilder.java new file mode 100644 index 000000000000..31e73ad8670c --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConfigOrBuilder.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface PscConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.PscConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The network where the IP address of the discovery endpoint will
+   * be reserved, in the form of
+   * projects/{network_project}/global/networks/{network_id}.
+   * 
+ * + * string network = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConnection.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConnection.java new file mode 100644 index 000000000000..ad0f9a54e355 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConnection.java @@ -0,0 +1,1394 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Details of consumer resources in a PSC connection.
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.PscConnection} + */ +public final class PscConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.PscConnection) + PscConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PscConnection.newBuilder() to construct. + private PscConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PscConnection() { + pscConnectionId_ = ""; + address_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PscConnection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.PscConnection.class, + com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder.class); + } + + public static final int PSC_CONNECTION_ID_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object pscConnectionId_ = ""; + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pscConnectionId. + */ + @java.lang.Override + public java.lang.String getPscConnectionId() { + java.lang.Object ref = pscConnectionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscConnectionId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pscConnectionId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPscConnectionIdBytes() { + java.lang.Object ref = pscConnectionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscConnectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object address_ = ""; + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + @java.lang.Override + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + @java.lang.Override + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORWARDING_RULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The forwardingRule. + */ + @java.lang.Override + public java.lang.String getForwardingRule() { + java.lang.Object ref = forwardingRule_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + forwardingRule_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for forwardingRule. + */ + @java.lang.Override + public com.google.protobuf.ByteString getForwardingRuleBytes() { + java.lang.Object ref = forwardingRule_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + forwardingRule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PROJECT_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object projectId_ = ""; + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + @java.lang.Override + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NETWORK_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @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; + } + } + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @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; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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(pscConnectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, address_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(forwardingRule_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, forwardingRule_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, network_); + } + 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(pscConnectionId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(address_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, address_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(forwardingRule_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, forwardingRule_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(projectId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, projectId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, network_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.PscConnection)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.PscConnection other = + (com.google.cloud.redis.cluster.v1beta1.PscConnection) obj; + + if (!getPscConnectionId().equals(other.getPscConnectionId())) return false; + if (!getAddress().equals(other.getAddress())) return false; + if (!getForwardingRule().equals(other.getForwardingRule())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getNetwork().equals(other.getNetwork())) 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) + PSC_CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPscConnectionId().hashCode(); + hash = (37 * hash) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + hash = (37 * hash) + FORWARDING_RULE_FIELD_NUMBER; + hash = (53 * hash) + getForwardingRule().hashCode(); + hash = (37 * hash) + PROJECT_ID_FIELD_NUMBER; + hash = (53 * hash) + getProjectId().hashCode(); + hash = (37 * hash) + NETWORK_FIELD_NUMBER; + hash = (53 * hash) + getNetwork().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.redis.cluster.v1beta1.PscConnection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 consumer resources in a PSC connection.
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.PscConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.PscConnection) + com.google.cloud.redis.cluster.v1beta1.PscConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.PscConnection.class, + com.google.cloud.redis.cluster.v1beta1.PscConnection.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.PscConnection.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pscConnectionId_ = ""; + address_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_PscConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConnection getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.PscConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConnection build() { + com.google.cloud.redis.cluster.v1beta1.PscConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConnection buildPartial() { + com.google.cloud.redis.cluster.v1beta1.PscConnection result = + new com.google.cloud.redis.cluster.v1beta1.PscConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.PscConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pscConnectionId_ = pscConnectionId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.address_ = address_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.forwardingRule_ = forwardingRule_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.network_ = network_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1beta1.PscConnection) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.PscConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.PscConnection other) { + if (other == com.google.cloud.redis.cluster.v1beta1.PscConnection.getDefaultInstance()) + return this; + if (!other.getPscConnectionId().isEmpty()) { + pscConnectionId_ = other.pscConnectionId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getForwardingRule().isEmpty()) { + forwardingRule_ = other.forwardingRule_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + 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: + { + pscConnectionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + forwardingRule_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + projectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + network_ = 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 pscConnectionId_ = ""; + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pscConnectionId. + */ + public java.lang.String getPscConnectionId() { + java.lang.Object ref = pscConnectionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pscConnectionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pscConnectionId. + */ + public com.google.protobuf.ByteString getPscConnectionIdBytes() { + java.lang.Object ref = pscConnectionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pscConnectionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The pscConnectionId to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + pscConnectionId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearPscConnectionId() { + pscConnectionId_ = getDefaultInstance().getPscConnectionId(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The PSC connection id of the forwarding rule connected to the
+     * service attachment.
+     * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for pscConnectionId to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pscConnectionId_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object address_ = ""; + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + public java.lang.String getAddress() { + java.lang.Object ref = address_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + address_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + public com.google.protobuf.ByteString getAddressBytes() { + java.lang.Object ref = address_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + address_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The address to set. + * @return This builder for chaining. + */ + public Builder setAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + address_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearAddress() { + address_ = getDefaultInstance().getAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for address to set. + * @return This builder for chaining. + */ + public Builder setAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + address_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The forwardingRule. + */ + public java.lang.String getForwardingRule() { + java.lang.Object ref = forwardingRule_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + forwardingRule_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for forwardingRule. + */ + public com.google.protobuf.ByteString getForwardingRuleBytes() { + java.lang.Object ref = forwardingRule_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + forwardingRule_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The forwardingRule to set. + * @return This builder for chaining. + */ + public Builder setForwardingRule(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + forwardingRule_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearForwardingRule() { + forwardingRule_ = getDefaultInstance().getForwardingRule(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Example:
+     * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+     * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for forwardingRule to set. + * @return This builder for chaining. + */ + public Builder setForwardingRuleBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + forwardingRule_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + public java.lang.String getProjectId() { + java.lang.Object ref = projectId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + projectId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + public com.google.protobuf.ByteString getProjectIdBytes() { + java.lang.Object ref = projectId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + projectId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + projectId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + projectId_ = getDefaultInstance().getProjectId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The consumer project_id where the forwarding rule is created
+     * from.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The bytes for projectId to set. + * @return This builder for chaining. + */ + public Builder setProjectIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + projectId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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; + } + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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; + } + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * string network = 5; + * + * @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_ |= 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.redis.cluster.v1beta1.PscConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.PscConnection) + private static final com.google.cloud.redis.cluster.v1beta1.PscConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.PscConnection(); + } + + public static com.google.cloud.redis.cluster.v1beta1.PscConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscConnection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.PscConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConnectionOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConnectionOrBuilder.java new file mode 100644 index 000000000000..93adf1a8ec7c --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/PscConnectionOrBuilder.java @@ -0,0 +1,162 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface PscConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.PscConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The pscConnectionId. + */ + java.lang.String getPscConnectionId(); + /** + * + * + *
+   * Output only. The PSC connection id of the forwarding rule connected to the
+   * service attachment.
+   * 
+ * + * string psc_connection_id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for pscConnectionId. + */ + com.google.protobuf.ByteString getPscConnectionIdBytes(); + + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + java.lang.String getAddress(); + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * string address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for address. + */ + com.google.protobuf.ByteString getAddressBytes(); + + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The forwardingRule. + */ + java.lang.String getForwardingRule(); + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Example:
+   * projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}.
+   * 
+ * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for forwardingRule. + */ + com.google.protobuf.ByteString getForwardingRuleBytes(); + + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Output only. The consumer project_id where the forwarding rule is created
+   * from.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * string network = 5; + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/TransitEncryptionMode.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/TransitEncryptionMode.java new file mode 100644 index 000000000000..79405bddc929 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/TransitEncryptionMode.java @@ -0,0 +1,181 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Available mode of in-transit encryption.
+ * 
+ * + * Protobuf enum {@code google.cloud.redis.cluster.v1beta1.TransitEncryptionMode} + */ +public enum TransitEncryptionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * In-transit encryption not set.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED(0), + /** + * + * + *
+   * In-transit encryption disabled.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + */ + TRANSIT_ENCRYPTION_MODE_DISABLED(1), + /** + * + * + *
+   * Use server managed encryption for in-transit encryption.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + */ + TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * In-transit encryption not set.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + public static final int TRANSIT_ENCRYPTION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * In-transit encryption disabled.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + */ + public static final int TRANSIT_ENCRYPTION_MODE_DISABLED_VALUE = 1; + /** + * + * + *
+   * Use server managed encryption for in-transit encryption.
+   * 
+ * + * TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; + */ + public static final int TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION_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 TransitEncryptionMode 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 TransitEncryptionMode forNumber(int value) { + switch (value) { + case 0: + return TRANSIT_ENCRYPTION_MODE_UNSPECIFIED; + case 1: + return TRANSIT_ENCRYPTION_MODE_DISABLED; + case 2: + return TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION; + 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 TransitEncryptionMode findValueByNumber(int number) { + return TransitEncryptionMode.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.redis.cluster.v1beta1.CloudRedisClusterProto.getDescriptor() + .getEnumTypes() + .get(1); + } + + private static final TransitEncryptionMode[] VALUES = values(); + + public static TransitEncryptionMode 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 TransitEncryptionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.redis.cluster.v1beta1.TransitEncryptionMode) +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/UpdateClusterRequest.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/UpdateClusterRequest.java new file mode 100644 index 000000000000..9021c7c34482 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/UpdateClusterRequest.java @@ -0,0 +1,1258 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +/** + * + * + *
+ * Request for [UpdateCluster][CloudRedis.UpdateCluster].
+ * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.UpdateClusterRequest} + */ +public final class UpdateClusterRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.redis.cluster.v1beta1.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(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest.Builder.class); + } + + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return updateMask_ != null; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @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.redis.cluster.v1beta1.Cluster cluster_; + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.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. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.Cluster getCluster() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClusterOrBuilder() { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @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; + } + } + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @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 (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_); + } + 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_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest)) { + return super.equals(obj); + } + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest other = + (com.google.cloud.redis.cluster.v1beta1.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 (!getUnknownFields().equals(other.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 = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.UpdateClusterRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.UpdateClusterRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.UpdateClusterRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.UpdateClusterRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.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; + } + /** + * + * + *
+   * Request for [UpdateCluster][CloudRedis.UpdateCluster].
+   * 
+ * + * Protobuf type {@code google.cloud.redis.cluster.v1beta1.UpdateClusterRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.redis.cluster.v1beta1.UpdateClusterRequest) + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_UpdateClusterRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest.class, + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest.Builder.class); + } + + // Construct using com.google.cloud.redis.cluster.v1beta1.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_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterProto + .internal_static_google_cloud_redis_cluster_v1beta1_UpdateClusterRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest getDefaultInstanceForType() { + return com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest build() { + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest buildPartial() { + com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest result = + new com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.redis.cluster.v1beta1.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_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest) { + return mergeFrom((com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest other) { + if (other == com.google.cloud.redis.cluster.v1beta1.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(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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_; + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @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(); + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Required. Mask of fields to update. At least one path must be supplied in
+     * this field. The elements of the repeated paths field may only include these
+     * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+     *
+     *  *   `size_gb`
+     *  *   `replica_count`
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + 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.redis.cluster.v1beta1.Cluster cluster_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder> + clusterBuilder_; + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + public boolean hasCluster() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster getCluster() { + if (clusterBuilder_ == null) { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } else { + return clusterBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster(com.google.cloud.redis.cluster.v1beta1.Cluster value) { + if (clusterBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + cluster_ = value; + } else { + clusterBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setCluster( + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder builderForValue) { + if (clusterBuilder_ == null) { + cluster_ = builderForValue.build(); + } else { + clusterBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeCluster(com.google.cloud.redis.cluster.v1beta1.Cluster value) { + if (clusterBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && cluster_ != null + && cluster_ != com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance()) { + getClusterBuilder().mergeFrom(value); + } else { + cluster_ = value; + } + } else { + clusterBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.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. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.Cluster.Builder getClusterBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getClusterFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClusterOrBuilder() { + if (clusterBuilder_ != null) { + return clusterBuilder_.getMessageOrBuilder(); + } else { + return cluster_ == null + ? com.google.cloud.redis.cluster.v1beta1.Cluster.getDefaultInstance() + : cluster_; + } + } + /** + * + * + *
+     * Required. Update description.
+     * Only fields specified in update_mask are updated.
+     * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder> + getClusterFieldBuilder() { + if (clusterBuilder_ == null) { + clusterBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.redis.cluster.v1beta1.Cluster, + com.google.cloud.redis.cluster.v1beta1.Cluster.Builder, + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder>( + getCluster(), getParentForChildren(), isClean()); + cluster_ = null; + } + return clusterBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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; + } + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Idempotent request UUID.
+     * 
+ * + * string request_id = 3; + * + * @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.redis.cluster.v1beta1.UpdateClusterRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.redis.cluster.v1beta1.UpdateClusterRequest) + private static final com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest(); + } + + public static com.google.cloud.redis.cluster.v1beta1.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.redis.cluster.v1beta1.UpdateClusterRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/UpdateClusterRequestOrBuilder.java b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/UpdateClusterRequestOrBuilder.java new file mode 100644 index 000000000000..42ec31b37ea6 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/java/com/google/cloud/redis/cluster/v1beta1/UpdateClusterRequestOrBuilder.java @@ -0,0 +1,147 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto + +package com.google.cloud.redis.cluster.v1beta1; + +public interface UpdateClusterRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.redis.cluster.v1beta1.UpdateClusterRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Required. Mask of fields to update. At least one path must be supplied in
+   * this field. The elements of the repeated paths field may only include these
+   * fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]:
+   *
+   *  *   `size_gb`
+   *  *   `replica_count`
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the cluster field is set. + */ + boolean hasCluster(); + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The cluster. + */ + com.google.cloud.redis.cluster.v1beta1.Cluster getCluster(); + /** + * + * + *
+   * Required. Update description.
+   * Only fields specified in update_mask are updated.
+   * 
+ * + * + * .google.cloud.redis.cluster.v1beta1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.redis.cluster.v1beta1.ClusterOrBuilder getClusterOrBuilder(); + + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Idempotent request UUID.
+   * 
+ * + * string request_id = 3; + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/proto/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/proto/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto new file mode 100644 index 000000000000..ee0c01c6cd40 --- /dev/null +++ b/java-redis-cluster/proto-google-cloud-redis-cluster-v1beta1/src/main/proto/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster.proto @@ -0,0 +1,453 @@ +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.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.redis.cluster.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "cloud.google.com/go/redis/cluster/apiv1beta1/clusterpb;clusterpb"; +option java_multiple_files = true; +option java_outer_classname = "CloudRedisClusterProto"; +option java_package = "com.google.cloud.redis.cluster.v1beta1"; + +// Configures and manages Cloud Memorystore for Redis clusters +// +// Google Cloud Memorystore for Redis Cluster +// +// The `redis.googleapis.com` service implements the Google Cloud Memorystore +// for Redis API and defines the following resource model for managing Redis +// clusters: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of Redis clusters, named: `/clusters/*` +// * As such, Redis clusters are resources of the form: +// `/projects/{project_id}/locations/{location_id}/clusters/{instance_id}` +// +// Note that location_id must be a GCP `region`; for example: +// * `projects/redpepper-1290/locations/us-central1/clusters/my-redis` +// +// We use API version selector for Flex APIs +// * The versioning strategy is release-based versioning +// * Our backend CLH only deals with the superset version (called v1main) +// * Existing backend for Redis Gen1 and MRR is not touched. +// * More details in go/redis-flex-api-versioning +service CloudRedisCluster { + option (google.api.default_host) = "redis.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all Redis clusters owned by a project in either the specified + // location (region) or all locations. + // + // The location should have the following format: + // + // * `projects/{project_id}/locations/{location_id}` + // + // If `location_id` is specified as `-` (wildcard), then all regions + // available to the project are queried, and the results are aggregated. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific Redis cluster. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the metadata and configuration of a specific Redis cluster. + // + // Completed longrunning.Operation will contain the new cluster object + // in the response field. The returned operation is automatically deleted + // after a few hours, so there is no need to call DeleteOperation. + rpc UpdateCluster(UpdateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{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: "google.protobuf.Any" + }; + } + + // Deletes a specific Redis cluster. Cluster stops serving and data is + // deleted. + rpc DeleteCluster(DeleteClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.protobuf.Any" + }; + } + + // Creates a Redis cluster based on the specified properties. + // The creation is executed asynchronously and callers may check the returned + // operation to track its progress. Once the operation is completed the Redis + // cluster will be fully functional. The completed longrunning.Operation will + // contain the new cluster object in the response field. + // + // The returned operation is automatically deleted after a few hours, so there + // is no need to call DeleteOperation. + rpc CreateCluster(CreateClusterRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{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: "google.protobuf.Any" + }; + } +} + +// Available authorization mode of a Redis cluster. +enum AuthorizationMode { + // Not set. + AUTH_MODE_UNSPECIFIED = 0; + + // IAM basic authorization mode + AUTH_MODE_IAM_AUTH = 1; + + // Authorization disabled mode + AUTH_MODE_DISABLED = 2; +} + +// Available mode of in-transit encryption. +enum TransitEncryptionMode { + // In-transit encryption not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + + // In-transit encryption disabled. + TRANSIT_ENCRYPTION_MODE_DISABLED = 1; + + // Use server managed encryption for in-transit encryption. + TRANSIT_ENCRYPTION_MODE_SERVER_AUTHENTICATION = 2; +} + +// Request for [CreateCluster][CloudRedis.CreateCluster]. +message CreateClusterRequest { + // Required. The resource name of the cluster location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The logical name of the Redis cluster in the customer project + // with the following restrictions: + // + // * Must contain only lowercase letters, numbers, and hyphens. + // * Must start with a letter. + // * Must be between 1-63 characters. + // * Must end with a number or a letter. + // * Must be unique within the customer project / location + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The cluster that is to be created. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 4; +} + +// Request for [ListClusters][CloudRedis.ListClusters]. +message ListClustersRequest { + // Required. The resource name of the cluster location using the form: + // `projects/{project_id}/locations/{location_id}` + // where `location_id` refers to a GCP region. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of items to return. + // + // If not specified, a default value of 1000 will be used by the service. + // Regardless of the page_size value, the response may include a partial list + // and a caller should only rely on response's + // [`next_page_token`][google.cloud.redis.cluster.v1beta1.ListClustersResponse.next_page_token] + // to determine if there are more clusters left to be queried. + int32 page_size = 2; + + // The `next_page_token` value returned from a previous + // [ListClusters][CloudRedis.ListClusters] request, if any. + string page_token = 3; +} + +// Response for [ListClusters][CloudRedis.ListClusters]. +message ListClustersResponse { + // A list of Redis clusters in the project in the specified location, + // or across all locations. + // + // If the `location_id` in the parent field of the request is "-", all regions + // available to the project are queried, and the results aggregated. + // If in such an aggregated query a location is unavailable, a placeholder + // Redis entry is included in the response with the `name` field set to a + // value of the form + // `projects/{project_id}/locations/{location_id}/clusters/`- and the + // `status` field set to ERROR and `status_message` field set to "location not + // available for ListClusters". + repeated Cluster clusters = 1; + + // Token to retrieve the next page of results, or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for [UpdateCluster][CloudRedis.UpdateCluster]. +message UpdateClusterRequest { + // Required. Mask of fields to update. At least one path must be supplied in + // this field. The elements of the repeated paths field may only include these + // fields from [Cluster][google.cloud.redis.cluster.v1beta1.Cluster]: + // + // * `size_gb` + // * `replica_count` + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. Update description. + // Only fields specified in update_mask are updated. + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Idempotent request UUID. + string request_id = 3; +} + +// Request for [GetCluster][CloudRedis.GetCluster]. +message GetClusterRequest { + // Required. Redis cluster resource name using the form: + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + // where `location_id` refers to a GCP region. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "redis.googleapis.com/Cluster" } + ]; +} + +// Request for [DeleteCluster][CloudRedis.DeleteCluster]. +message DeleteClusterRequest { + // Required. Redis cluster resource name using the form: + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + // where `location_id` refers to a GCP region. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "redis.googleapis.com/Cluster" } + ]; + + // Idempotent request UUID. + string request_id = 2; +} + +// A cluster instance. +message Cluster { + option (google.api.resource) = { + type: "redis.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/clusters/{cluster}" + }; + + // Represents additional information about the state of the cluster. + message StateInfo { + // Represents information about an updating cluster. + message UpdateInfo { + // Target number of shards for redis cluster + optional int32 target_shard_count = 1; + + // Target number of replica nodes per shard. + optional int32 target_replica_count = 2; + } + + oneof info { + // Describes ongoing update on the cluster when cluster state is UPDATING. + UpdateInfo update_info = 1; + } + } + + // Represents the different states of a Redis cluster. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // Redis cluster is being created. + CREATING = 1; + + // Redis cluster has been created and is fully usable. + ACTIVE = 2; + + // Redis cluster configuration is being updated. + UPDATING = 3; + + // Redis cluster is being deleted. + DELETING = 4; + } + + // Required. Unique name of the resource in this scope including project and + // location using the form: + // `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}` + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The timestamp associated with the cluster creation request. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this cluster. + // Can be CREATING, READY, UPDATING, DELETING and SUSPENDED + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. System assigned, unique identifier for the cluster. + string uid = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The number of replica nodes per shard. + optional int32 replica_count = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The authorization mode of the Redis cluster. + // If not provided, auth feature is disabled for the cluster. + AuthorizationMode authorization_mode = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The in-transit encryption for the Redis cluster. + // If not provided, encryption is disabled for the cluster. + TransitEncryptionMode transit_encryption_mode = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Redis memory size in GB for the entire cluster. + optional int32 size_gb = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Number of shards for the Redis cluster. + optional int32 shard_count = 14 [(google.api.field_behavior) = REQUIRED]; + + // Required. Each PscConfig configures the consumer network where IPs will + // be designated to the cluster for client access through Private Service + // Connect Automation. Currently, only one PscConfig is supported. + repeated PscConfig psc_configs = 15 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Endpoints created on each given network, for Redis clients to + // connect to the cluster. Currently only one discovery endpoint is supported. + repeated DiscoveryEndpoint discovery_endpoints = 16 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. PSC connections for discovery of the cluster topology and + // accessing the cluster. + repeated PscConnection psc_connections = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the current state of the cluster. + StateInfo state_info = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +message PscConfig { + // Required. The network where the IP address of the discovery endpoint will + // be reserved, in the form of + // projects/{network_project}/global/networks/{network_id}. + string network = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Endpoints on each network, for Redis clients to connect to the cluster. +message DiscoveryEndpoint { + // Output only. Address of the exposed Redis endpoint used by clients to + // connect to the service. The address could be either IP or hostname. + string address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the exposed Redis endpoint. + int32 port = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Customer configuration for where the endpoint is created and + // accessed from. + PscConfig psc_config = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Details of consumer resources in a PSC connection. +message PscConnection { + // Output only. The PSC connection id of the forwarding rule connected to the + // service attachment. + string psc_connection_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The IP allocated on the consumer network for the PSC + // forwarding rule. + string address = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The URI of the consumer side forwarding rule. + // Example: + // projects/{projectNumOrId}/regions/us-east1/forwardingRules/{resourceId}. + string forwarding_rule = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The consumer project_id where the forwarding rule is created + // from. + string project_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The consumer network where the IP address resides, in the form of + // projects/{project_id}/global/networks/{network_id}. + string network = 5; +} + +// Pre-defined metadata fields. +message OperationMetadata { + // 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-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetCredentialsProvider.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..afecdbbbae25 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterSettings; +import com.google.cloud.redis.cluster.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 + CloudRedisClusterSettings cloudRedisClusterSettings = + CloudRedisClusterSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudRedisClusterClient cloudRedisClusterClient = + CloudRedisClusterClient.create(cloudRedisClusterSettings); + } +} +// [END redis_v1_generated_CloudRedisCluster_Create_SetCredentialsProvider_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetCredentialsProvider1.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..bedc1551e733 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_Create_SetCredentialsProvider1_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterSettings; + +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 + CloudRedisClusterSettings cloudRedisClusterSettings = + CloudRedisClusterSettings.newHttpJsonBuilder().build(); + CloudRedisClusterClient cloudRedisClusterClient = + CloudRedisClusterClient.create(cloudRedisClusterSettings); + } +} +// [END redis_v1_generated_CloudRedisCluster_Create_SetCredentialsProvider1_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetEndpoint.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..246df764240d --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_Create_SetEndpoint_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterSettings; +import com.google.cloud.redis.cluster.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 + CloudRedisClusterSettings cloudRedisClusterSettings = + CloudRedisClusterSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudRedisClusterClient cloudRedisClusterClient = + CloudRedisClusterClient.create(cloudRedisClusterSettings); + } +} +// [END redis_v1_generated_CloudRedisCluster_Create_SetEndpoint_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/AsyncCreateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/AsyncCreateCluster.java new file mode 100644 index 000000000000..d8197e1e653b --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/AsyncCreateCluster.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_CreateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.CreateClusterRequest; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + cloudRedisClusterClient.createClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_CreateCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/AsyncCreateClusterLRO.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/AsyncCreateClusterLRO.java new file mode 100644 index 000000000000..38a5d99fa252 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/AsyncCreateClusterLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_CreateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1.LocationName; +import com.google.protobuf.Any; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + cloudRedisClusterClient.createClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_CreateCluster_LRO_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateCluster.java new file mode 100644 index 000000000000..86b4f8de23c7 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_CreateCluster_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.CreateClusterRequest; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Cluster response = cloudRedisClusterClient.createClusterAsync(request).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateClusterLocationnameClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateClusterLocationnameClusterString.java new file mode 100644 index 000000000000..422620972b4a --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateClusterLocationnameClusterString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_CreateCluster_LocationnameClusterString_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_CreateCluster_LocationnameClusterString_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateClusterStringClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateClusterStringClusterString.java new file mode 100644 index 000000000000..fce925e18234 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/createcluster/SyncCreateClusterStringClusterString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_CreateCluster_StringClusterString_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_CreateCluster_StringClusterString_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/AsyncDeleteCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/AsyncDeleteCluster.java new file mode 100644 index 000000000000..fab0ec19d1c1 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/AsyncDeleteCluster.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_DeleteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.ClusterName; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + cloudRedisClusterClient.deleteClusterCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/AsyncDeleteClusterLRO.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/AsyncDeleteClusterLRO.java new file mode 100644 index 000000000000..b3cbcefcdd26 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/AsyncDeleteClusterLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_DeleteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.ClusterName; +import com.google.cloud.redis.cluster.v1.DeleteClusterRequest; +import com.google.protobuf.Any; +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + cloudRedisClusterClient.deleteClusterOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_LRO_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteCluster.java new file mode 100644 index 000000000000..d20517b823de --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteCluster.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.ClusterName; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .build(); + cloudRedisClusterClient.deleteClusterAsync(request).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteClusterClustername.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteClusterClustername.java new file mode 100644 index 000000000000..43f78241ea8e --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_DeleteCluster_Clustername_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + cloudRedisClusterClient.deleteClusterAsync(name).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_Clustername_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteClusterString.java new file mode 100644 index 000000000000..722fe49c3714 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/deletecluster/SyncDeleteClusterString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_DeleteCluster_String_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + cloudRedisClusterClient.deleteClusterAsync(name).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_DeleteCluster_String_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/AsyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/AsyncGetCluster.java new file mode 100644 index 000000000000..2236a32bdf93 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/AsyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_GetCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.ClusterName; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + ApiFuture future = cloudRedisClusterClient.getClusterCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_GetCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..d4da1a426bfb --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetCluster.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_GetCluster_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.ClusterName; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + Cluster response = cloudRedisClusterClient.getCluster(request); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetClusterClustername.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetClusterClustername.java new file mode 100644 index 000000000000..b2281fd72544 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetClusterClustername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_GetCluster_Clustername_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = cloudRedisClusterClient.getCluster(name); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_GetCluster_Clustername_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetClusterString.java new file mode 100644 index 000000000000..a4fbec265ed8 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getcluster/SyncGetClusterString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_GetCluster_String_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = cloudRedisClusterClient.getCluster(name); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_GetCluster_String_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getlocation/AsyncGetLocation.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..b6c50aa2fa69 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getlocation/AsyncGetLocation.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + cloudRedisClusterClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_GetLocation_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getlocation/SyncGetLocation.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..0db8f0793210 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = cloudRedisClusterClient.getLocation(request); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_GetLocation_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/AsyncListClusters.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/AsyncListClusters.java new file mode 100644 index 000000000000..6b821c91effa --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/AsyncListClusters.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListClusters_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.ListClustersRequest; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudRedisClusterClient.listClustersPagedCallable().futureCall(request); + // Do something. + for (Cluster element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1_generated_CloudRedisCluster_ListClusters_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/AsyncListClustersPaged.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/AsyncListClustersPaged.java new file mode 100644 index 000000000000..54f674a26f5c --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/AsyncListClustersPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListClusters_Paged_async] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1.ListClustersResponse; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListClustersResponse response = + cloudRedisClusterClient.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 redis_v1_generated_CloudRedisCluster_ListClusters_Paged_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClusters.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClusters.java new file mode 100644 index 000000000000..39b6d7960760 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClusters.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListClusters_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.ListClustersRequest; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Cluster element : cloudRedisClusterClient.listClusters(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClustersLocationname.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClustersLocationname.java new file mode 100644 index 000000000000..0252d3d62e58 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClustersLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListClusters_Locationname_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1_generated_CloudRedisCluster_ListClusters_Locationname_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClustersString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClustersString.java new file mode 100644 index 000000000000..6b79cf9bf561 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listclusters/SyncListClustersString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListClusters_String_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1_generated_CloudRedisCluster_ListClusters_String_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/AsyncListLocations.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..b9ee38db8432 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudRedisClusterClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1_generated_CloudRedisCluster_ListLocations_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/AsyncListLocationsPaged.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..6e5c84f145ec --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + cloudRedisClusterClient.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 redis_v1_generated_CloudRedisCluster_ListLocations_Paged_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/SyncListLocations.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..572a8381cbe0 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : cloudRedisClusterClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1_generated_CloudRedisCluster_ListLocations_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/AsyncUpdateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/AsyncUpdateCluster.java new file mode 100644 index 000000000000..96c4f7d53d8b --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/AsyncUpdateCluster.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_UpdateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + cloudRedisClusterClient.updateClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/AsyncUpdateClusterLRO.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/AsyncUpdateClusterLRO.java new file mode 100644 index 000000000000..e9d80d8410c4 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/AsyncUpdateClusterLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_UpdateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.v1.UpdateClusterRequest; +import com.google.protobuf.Any; +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + cloudRedisClusterClient.updateClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_LRO_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/SyncUpdateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/SyncUpdateCluster.java new file mode 100644 index 000000000000..074f0efd94cd --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/SyncUpdateCluster.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1.Cluster; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Cluster response = cloudRedisClusterClient.updateClusterAsync(request).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/SyncUpdateClusterClusterFieldmask.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/SyncUpdateClusterClusterFieldmask.java new file mode 100644 index 000000000000..e57a5cc8bd6e --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudrediscluster/updatecluster/SyncUpdateClusterClusterFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisCluster_UpdateCluster_ClusterFieldmask_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Cluster response = cloudRedisClusterClient.updateClusterAsync(cluster, updateMask).get(); + } + } +} +// [END redis_v1_generated_CloudRedisCluster_UpdateCluster_ClusterFieldmask_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudredisclustersettings/getcluster/SyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudredisclustersettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..e782e67c629c --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/cloudredisclustersettings/getcluster/SyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.samples; + +// [START redis_v1_generated_CloudRedisClusterSettings_GetCluster_sync] +import com.google.cloud.redis.cluster.v1.CloudRedisClusterSettings; +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 + CloudRedisClusterSettings.Builder cloudRedisClusterSettingsBuilder = + CloudRedisClusterSettings.newBuilder(); + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .setRetrySettings( + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudRedisClusterSettings cloudRedisClusterSettings = cloudRedisClusterSettingsBuilder.build(); + } +} +// [END redis_v1_generated_CloudRedisClusterSettings_GetCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/stub/cloudredisclusterstubsettings/getcluster/SyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/stub/cloudredisclusterstubsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..25a1e36a4991 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1/stub/cloudredisclusterstubsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1.stub.samples; + +// [START redis_v1_generated_CloudRedisClusterStubSettings_GetCluster_sync] +import com.google.cloud.redis.cluster.v1.stub.CloudRedisClusterStubSettings; +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 + CloudRedisClusterStubSettings.Builder cloudRedisClusterSettingsBuilder = + CloudRedisClusterStubSettings.newBuilder(); + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .setRetrySettings( + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudRedisClusterStubSettings cloudRedisClusterSettings = + cloudRedisClusterSettingsBuilder.build(); + } +} +// [END redis_v1_generated_CloudRedisClusterStubSettings_GetCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetCredentialsProvider.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..36b95d2e9b39 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterSettings; +import com.google.cloud.redis.cluster.v1beta1.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 + CloudRedisClusterSettings cloudRedisClusterSettings = + CloudRedisClusterSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + CloudRedisClusterClient cloudRedisClusterClient = + CloudRedisClusterClient.create(cloudRedisClusterSettings); + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_Create_SetCredentialsProvider_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetCredentialsProvider1.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetCredentialsProvider1.java new file mode 100644 index 000000000000..47d9e02854aa --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetCredentialsProvider1.java @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_Create_SetCredentialsProvider1_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterSettings; + +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 + CloudRedisClusterSettings cloudRedisClusterSettings = + CloudRedisClusterSettings.newHttpJsonBuilder().build(); + CloudRedisClusterClient cloudRedisClusterClient = + CloudRedisClusterClient.create(cloudRedisClusterSettings); + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_Create_SetCredentialsProvider1_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetEndpoint.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..2b356352b2e2 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/create/SyncCreateSetEndpoint.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_Create_SetEndpoint_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterSettings; +import com.google.cloud.redis.cluster.v1beta1.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 + CloudRedisClusterSettings cloudRedisClusterSettings = + CloudRedisClusterSettings.newBuilder().setEndpoint(myEndpoint).build(); + CloudRedisClusterClient cloudRedisClusterClient = + CloudRedisClusterClient.create(cloudRedisClusterSettings); + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_Create_SetEndpoint_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/AsyncCreateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/AsyncCreateCluster.java new file mode 100644 index 000000000000..859c28bbefa5 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/AsyncCreateCluster.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_CreateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + cloudRedisClusterClient.createClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_CreateCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/AsyncCreateClusterLRO.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/AsyncCreateClusterLRO.java new file mode 100644 index 000000000000..32bc25b54667 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/AsyncCreateClusterLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_CreateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.LocationName; +import com.google.protobuf.Any; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + cloudRedisClusterClient.createClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_CreateCluster_LRO_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateCluster.java new file mode 100644 index 000000000000..0cd1467c7bb2 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.CreateClusterRequest; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + CreateClusterRequest request = + CreateClusterRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setClusterId("clusterId561939637") + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Cluster response = cloudRedisClusterClient.createClusterAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_CreateCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateClusterLocationnameClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateClusterLocationnameClusterString.java new file mode 100644 index 000000000000..a6a15e962f77 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateClusterLocationnameClusterString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_CreateCluster_LocationnameClusterString_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_CreateCluster_LocationnameClusterString_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateClusterStringClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateClusterStringClusterString.java new file mode 100644 index 000000000000..d5dfe5d59102 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/createcluster/SyncCreateClusterStringClusterString.java @@ -0,0 +1,45 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_CreateCluster_StringClusterString_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Cluster cluster = Cluster.newBuilder().build(); + String clusterId = "clusterId561939637"; + Cluster response = + cloudRedisClusterClient.createClusterAsync(parent, cluster, clusterId).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_CreateCluster_StringClusterString_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/AsyncDeleteCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/AsyncDeleteCluster.java new file mode 100644 index 000000000000..591a63c66f56 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/AsyncDeleteCluster.java @@ -0,0 +1,51 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.ClusterName; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + cloudRedisClusterClient.deleteClusterCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/AsyncDeleteClusterLRO.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/AsyncDeleteClusterLRO.java new file mode 100644 index 000000000000..7c75ed054b6a --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/AsyncDeleteClusterLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.ClusterName; +import com.google.cloud.redis.cluster.v1beta1.DeleteClusterRequest; +import com.google.protobuf.Any; +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + cloudRedisClusterClient.deleteClusterOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_LRO_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteCluster.java new file mode 100644 index 000000000000..451c02e2c73e --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteCluster.java @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.ClusterName; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + DeleteClusterRequest request = + DeleteClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .setRequestId("requestId693933066") + .build(); + cloudRedisClusterClient.deleteClusterAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteClusterClustername.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteClusterClustername.java new file mode 100644 index 000000000000..98557c3a4593 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteClusterClustername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_Clustername_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + cloudRedisClusterClient.deleteClusterAsync(name).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_Clustername_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteClusterString.java new file mode 100644 index 000000000000..7c14afffa44e --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/deletecluster/SyncDeleteClusterString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_String_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + cloudRedisClusterClient.deleteClusterAsync(name).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_DeleteCluster_String_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/AsyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/AsyncGetCluster.java new file mode 100644 index 000000000000..4fdd5f36abb6 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/AsyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_GetCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.ClusterName; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + ApiFuture future = cloudRedisClusterClient.getClusterCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..0e2aecfd6669 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetCluster.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.ClusterName; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetClusterRequest request = + GetClusterRequest.newBuilder() + .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) + .build(); + Cluster response = cloudRedisClusterClient.getCluster(request); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetClusterClustername.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetClusterClustername.java new file mode 100644 index 000000000000..485d2c7ea4b7 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetClusterClustername.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_GetCluster_Clustername_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); + Cluster response = cloudRedisClusterClient.getCluster(name); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_Clustername_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetClusterString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetClusterString.java new file mode 100644 index 000000000000..eba8eb71c1b9 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getcluster/SyncGetClusterString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_GetCluster_String_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); + Cluster response = cloudRedisClusterClient.getCluster(name); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_GetCluster_String_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getlocation/AsyncGetLocation.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..c0fa0a752636 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getlocation/AsyncGetLocation.java @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = + cloudRedisClusterClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_GetLocation_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getlocation/SyncGetLocation.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..565075e08e14 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = cloudRedisClusterClient.getLocation(request); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_GetLocation_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/AsyncListClusters.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/AsyncListClusters.java new file mode 100644 index 000000000000..c93603be4c73 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/AsyncListClusters.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListClusters_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudRedisClusterClient.listClustersPagedCallable().futureCall(request); + // Do something. + for (Cluster element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/AsyncListClustersPaged.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/AsyncListClustersPaged.java new file mode 100644 index 000000000000..55e52efffcdd --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/AsyncListClustersPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListClusters_Paged_async] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1beta1.ListClustersResponse; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListClustersResponse response = + cloudRedisClusterClient.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 redis_v1beta1_generated_CloudRedisCluster_ListClusters_Paged_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClusters.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClusters.java new file mode 100644 index 000000000000..baaa807c7dc6 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClusters.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.ListClustersRequest; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListClustersRequest request = + ListClustersRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Cluster element : cloudRedisClusterClient.listClusters(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClustersLocationname.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClustersLocationname.java new file mode 100644 index 000000000000..a977b8a6838b --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClustersLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListClusters_Locationname_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_Locationname_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClustersString.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClustersString.java new file mode 100644 index 000000000000..8a698709b06e --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listclusters/SyncListClustersString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListClusters_String_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Cluster element : cloudRedisClusterClient.listClusters(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_ListClusters_String_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/AsyncListLocations.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..ef688db19329 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + cloudRedisClusterClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_ListLocations_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/AsyncListLocationsPaged.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..2a9576c4c0c8 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,62 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListLocations_Paged_async] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = + cloudRedisClusterClient.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 redis_v1beta1_generated_CloudRedisCluster_ListLocations_Paged_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/SyncListLocations.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..b090a8fde7b7 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; + +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : cloudRedisClusterClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_ListLocations_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/AsyncUpdateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/AsyncUpdateCluster.java new file mode 100644 index 000000000000..ed12f349077f --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/AsyncUpdateCluster.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = + cloudRedisClusterClient.updateClusterCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/AsyncUpdateClusterLRO.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/AsyncUpdateClusterLRO.java new file mode 100644 index 000000000000..f84b022771cc --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/AsyncUpdateClusterLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.UpdateClusterRequest; +import com.google.protobuf.Any; +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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + cloudRedisClusterClient.updateClusterOperationCallable().futureCall(request); + // Do something. + Cluster response = future.get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_LRO_async] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/SyncUpdateCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/SyncUpdateCluster.java new file mode 100644 index 000000000000..3d5960f1548e --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/SyncUpdateCluster.java @@ -0,0 +1,48 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.Cluster; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + UpdateClusterRequest request = + UpdateClusterRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setCluster(Cluster.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Cluster response = cloudRedisClusterClient.updateClusterAsync(request).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/SyncUpdateClusterClusterFieldmask.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/SyncUpdateClusterClusterFieldmask.java new file mode 100644 index 000000000000..c85d345d8b36 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudrediscluster/updatecluster/SyncUpdateClusterClusterFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_ClusterFieldmask_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterClient; +import com.google.cloud.redis.cluster.v1beta1.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 (CloudRedisClusterClient cloudRedisClusterClient = CloudRedisClusterClient.create()) { + Cluster cluster = Cluster.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Cluster response = cloudRedisClusterClient.updateClusterAsync(cluster, updateMask).get(); + } + } +} +// [END redis_v1beta1_generated_CloudRedisCluster_UpdateCluster_ClusterFieldmask_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudredisclustersettings/getcluster/SyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudredisclustersettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..cd7d7024f5cd --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/cloudredisclustersettings/getcluster/SyncGetCluster.java @@ -0,0 +1,49 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.samples; + +// [START redis_v1beta1_generated_CloudRedisClusterSettings_GetCluster_sync] +import com.google.cloud.redis.cluster.v1beta1.CloudRedisClusterSettings; +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 + CloudRedisClusterSettings.Builder cloudRedisClusterSettingsBuilder = + CloudRedisClusterSettings.newBuilder(); + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .setRetrySettings( + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudRedisClusterSettings cloudRedisClusterSettings = cloudRedisClusterSettingsBuilder.build(); + } +} +// [END redis_v1beta1_generated_CloudRedisClusterSettings_GetCluster_sync] diff --git a/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/stub/cloudredisclusterstubsettings/getcluster/SyncGetCluster.java b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/stub/cloudredisclusterstubsettings/getcluster/SyncGetCluster.java new file mode 100644 index 000000000000..3b9971c3c063 --- /dev/null +++ b/java-redis-cluster/samples/snippets/generated/com/google/cloud/redis/cluster/v1beta1/stub/cloudredisclusterstubsettings/getcluster/SyncGetCluster.java @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.redis.cluster.v1beta1.stub.samples; + +// [START redis_v1beta1_generated_CloudRedisClusterStubSettings_GetCluster_sync] +import com.google.cloud.redis.cluster.v1beta1.stub.CloudRedisClusterStubSettings; +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 + CloudRedisClusterStubSettings.Builder cloudRedisClusterSettingsBuilder = + CloudRedisClusterStubSettings.newBuilder(); + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .setRetrySettings( + cloudRedisClusterSettingsBuilder + .getClusterSettings() + .getRetrySettings() + .toBuilder() + .setTotalTimeout(Duration.ofSeconds(30)) + .build()); + CloudRedisClusterStubSettings cloudRedisClusterSettings = + cloudRedisClusterSettingsBuilder.build(); + } +} +// [END redis_v1beta1_generated_CloudRedisClusterStubSettings_GetCluster_sync] diff --git a/pom.xml b/pom.xml index 02fe69fcfe2b..c38fadafbee2 100644 --- a/pom.xml +++ b/pom.xml @@ -136,6 +136,7 @@ java-recaptchaenterprise java-recommendations-ai java-recommender + java-redis-cluster java-redis java-resourcemanager java-resource-settings diff --git a/versions.txt b/versions.txt index 84336f9ba1c1..fdb0de147d44 100644 --- a/versions.txt +++ b/versions.txt @@ -685,4 +685,9 @@ proto-google-shopping-merchant-reports-v1beta:0.4.0:0.5.0-SNAPSHOT grpc-google-shopping-merchant-reports-v1beta:0.4.0:0.5.0-SNAPSHOT proto-google-cloud-alloydb-connectors-v1:0.6.0:0.7.0-SNAPSHOT proto-google-cloud-discoveryengine-v1alpha:0.24.0:0.25.0-SNAPSHOT -grpc-google-cloud-discoveryengine-v1alpha:0.24.0:0.25.0-SNAPSHOT \ No newline at end of file +grpc-google-cloud-discoveryengine-v1alpha:0.24.0:0.25.0-SNAPSHOT +google-cloud-redis-cluster:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-redis-cluster-v1beta1:0.0.0:0.0.1-SNAPSHOT +proto-google-cloud-redis-cluster-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-redis-cluster-v1:0.0.0:0.0.1-SNAPSHOT +grpc-google-cloud-redis-cluster-v1beta1:0.0.0:0.0.1-SNAPSHOT