diff --git a/gapic-libraries-bom/pom.xml b/gapic-libraries-bom/pom.xml index fb5cee730a88..481425f13ea7 100644 --- a/gapic-libraries-bom/pom.xml +++ b/gapic-libraries-bom/pom.xml @@ -1158,6 +1158,13 @@ pom import + + com.google.cloud + google-cloud-valkey-bom + 0.0.1-SNAPSHOT + pom + import + com.google.cloud google-cloud-vertexai-bom diff --git a/generation_config.yaml b/generation_config.yaml index 6ed58f09bed1..5d9ec17b39e8 100644 --- a/generation_config.yaml +++ b/generation_config.yaml @@ -1434,6 +1434,24 @@ libraries: - proto_path: google/cloud/memcache/v1 - proto_path: google/cloud/memcache/v1beta2 +- api_shortname: memorystore + name_pretty: Memorystore API + product_documentation: https://cloud.google.com/memorystore/docs/valkey + api_description: Memorystore for Valkey is a fully managed Valkey Cluster service + for Google Cloud. + client_documentation: + https://cloud.google.com/java/docs/reference/google-cloud-memorystore/latest/overview + release_level: stable + api_id: memorystore.googleapis.com + library_type: GAPIC_AUTO + group_id: com.google.cloud + cloud_api: true + library_name: valkey + GAPICs: + - proto_path: google/cloud/memorystore/v1 + - proto_path: google/cloud/memorystore/v1beta + requires_billing: true + rest_documentation: https://cloud.google.com/memorystore/docs/valkey/reference/rest - api_shortname: migrationcenter name_pretty: Migration Center API product_documentation: https://cloud.google.com/migration-center/docs/migration-center-overview @@ -2119,22 +2137,6 @@ libraries: - proto_path: google/shopping/merchant/lfp/v1beta requires_billing: true -- api_shortname: merchantapi - name_pretty: Merchant API - product_documentation: https://developers.google.com/merchant/api - api_description: Programmatically manage your Merchant Center Accounts. - client_documentation: - https://cloud.google.com/java/docs/reference/google-shopping-merchant-reviews/latest/overview - release_level: preview - distribution_name: com.google.shopping:google-shopping-merchant-reviews - library_type: GAPIC_AUTO - group_id: com.google.shopping - cloud_api: false - GAPICs: - - proto_path: google/shopping/merchant/reviews/v1beta - requires_billing: true - library_name: shopping-merchant-reviews - - api_shortname: merchantapi name_pretty: Merchant API product_documentation: https://developers.google.com/merchant/api @@ -2192,6 +2194,22 @@ libraries: GAPICs: - proto_path: google/shopping/merchant/reports/v1beta +- api_shortname: merchantapi + name_pretty: Merchant API + product_documentation: https://developers.google.com/merchant/api + api_description: Programmatically manage your Merchant Center Accounts. + client_documentation: + https://cloud.google.com/java/docs/reference/google-shopping-merchant-reviews/latest/overview + release_level: preview + distribution_name: com.google.shopping:google-shopping-merchant-reviews + library_type: GAPIC_AUTO + group_id: com.google.shopping + cloud_api: false + GAPICs: + - proto_path: google/shopping/merchant/reviews/v1beta + requires_billing: true + library_name: shopping-merchant-reviews + - api_shortname: speech name_pretty: Cloud Speech product_documentation: https://cloud.google.com/speech-to-text/docs/ diff --git a/java-valkey/.OwlBot-hermetic.yaml b/java-valkey/.OwlBot-hermetic.yaml new file mode 100644 index 000000000000..74b30125c2c3 --- /dev/null +++ b/java-valkey/.OwlBot-hermetic.yaml @@ -0,0 +1,35 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.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-valkey/grpc-google-.*/src" +- "/java-valkey/proto-google-.*/src" +- "/java-valkey/google-.*/src" +- "/java-valkey/samples/snippets/generated" + +deep-preserve-regex: +- "/java-valkey/google-.*/src/test/java/com/google/cloud/.*/v.*/it/IT.*Test.java" + +deep-copy-regex: +- source: "/google/cloud/memorystore/(v.*)/.*-java/proto-google-.*/src" + dest: "/owl-bot-staging/java-valkey/$1/proto-google-cloud-valkey-$1/src" +- source: "/google/cloud/memorystore/(v.*)/.*-java/grpc-google-.*/src" + dest: "/owl-bot-staging/java-valkey/$1/grpc-google-cloud-valkey-$1/src" +- source: "/google/cloud/memorystore/(v.*)/.*-java/gapic-google-.*/src" + dest: "/owl-bot-staging/java-valkey/$1/google-cloud-valkey/src" +- source: "/google/cloud/memorystore/(v.*)/.*-java/samples/snippets/generated" + dest: "/owl-bot-staging/java-valkey/$1/samples/snippets/generated" + +api-name: memorystore \ No newline at end of file diff --git a/java-valkey/.repo-metadata.json b/java-valkey/.repo-metadata.json new file mode 100644 index 000000000000..2b9604b7da5f --- /dev/null +++ b/java-valkey/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_shortname": "memorystore", + "name_pretty": "Memorystore API", + "product_documentation": "https://cloud.google.com/memorystore/docs/valkey", + "api_description": "Memorystore for Valkey is a fully managed Valkey Cluster service for Google Cloud.", + "client_documentation": "https://cloud.google.com/java/docs/reference/google-cloud-memorystore/latest/overview", + "release_level": "stable", + "transport": "http", + "language": "java", + "repo": "googleapis/google-cloud-java", + "repo_short": "java-valkey", + "distribution_name": "com.google.cloud:google-cloud-valkey", + "api_id": "memorystore.googleapis.com", + "library_type": "GAPIC_AUTO", + "requires_billing": true, + "rest_documentation": "https://cloud.google.com/memorystore/docs/valkey/reference/rest" +} \ No newline at end of file diff --git a/java-valkey/README.md b/java-valkey/README.md new file mode 100644 index 000000000000..a62da152ded6 --- /dev/null +++ b/java-valkey/README.md @@ -0,0 +1,218 @@ +# Google Memorystore API Client for Java + +Java idiomatic client for [Memorystore API][product-docs]. + +[![Maven][maven-version-image]][maven-version-link] +![Stability][stability-image] + +- [Product Documentation][product-docs] +- [Client Library Documentation][javadocs] + + +## Quickstart + + +If you are using Maven with [BOM][libraries-bom], add this to your pom.xml file: + +```xml + + + + com.google.cloud + libraries-bom + 26.51.0 + pom + import + + + + + + + com.google.cloud + google-cloud-valkey + + +``` + +If you are using Maven without the BOM, add this to your dependencies: + + +```xml + + com.google.cloud + google-cloud-valkey + 0.0.0 + +``` + +If you are using Gradle without BOM, add this to your dependencies: + +```Groovy +implementation 'com.google.cloud:google-cloud-valkey:0.0.0' +``` + +If you are using SBT, add this to your dependencies: + +```Scala +libraryDependencies += "com.google.cloud" % "google-cloud-valkey" % "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 Memorystore API APIs, and the authenticated principal must have the [IAM role(s)][predefined-iam-roles] required to access GCP resources using the Memorystore API API calls. + +## Getting Started + +### Prerequisites + +You will need a [Google Cloud Platform Console][developer-console] project with the Memorystore API [API enabled][enable-api]. +You will need to [enable billing][enable-billing] to use Google Memorystore 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-valkey` library. See the [Quickstart](#quickstart) section +to add `google-cloud-valkey` as a dependency in your code. + +## About Memorystore API + + +[Memorystore API][product-docs] Memorystore for Valkey is a fully managed Valkey Cluster service for Google Cloud. + +See the [Memorystore API client library docs][javadocs] to learn how to +use this Memorystore API Client Library. + + + + + + +## Troubleshooting + +To get help, follow the instructions in the [shared Troubleshooting document][troubleshooting]. + +## Transport + +Memorystore API uses HTTP/JSON 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/). + + + +## 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/valkey +[javadocs]: https://cloud.google.com/java/docs/reference/google-cloud-memorystore/latest/overview +[kokoro-badge-image-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.svg +[kokoro-badge-link-1]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java7.html +[kokoro-badge-image-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.svg +[kokoro-badge-link-2]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8.html +[kokoro-badge-image-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.svg +[kokoro-badge-link-3]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-osx.html +[kokoro-badge-image-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.svg +[kokoro-badge-link-4]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java8-win.html +[kokoro-badge-image-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.svg +[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html +[stability-image]: https://img.shields.io/badge/stability-stable-green +[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-valkey.svg +[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-valkey/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/google-cloud-java/blob/main/CONTRIBUTING.md +[code-of-conduct]: https://github.com/googleapis/google-cloud-java/blob/main/CODE_OF_CONDUCT.md#contributor-code-of-conduct +[license]: https://github.com/googleapis/google-cloud-java/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=memorystore.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-valkey/google-cloud-valkey-bom/pom.xml b/java-valkey/google-cloud-valkey-bom/pom.xml new file mode 100644 index 000000000000..f6a7eb301dd6 --- /dev/null +++ b/java-valkey/google-cloud-valkey-bom/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + com.google.cloud + google-cloud-valkey-bom + 0.0.1-SNAPSHOT + pom + + com.google.cloud + google-cloud-pom-parent + 1.49.0-SNAPSHOT + ../../google-cloud-pom-parent/pom.xml + + + Google Memorystore API BOM + + BOM for Memorystore API + + + + true + + + + + + com.google.cloud + google-cloud-valkey + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-valkey-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-valkey-v1beta + 0.0.1-SNAPSHOT + + + + diff --git a/java-valkey/google-cloud-valkey/pom.xml b/java-valkey/google-cloud-valkey/pom.xml new file mode 100644 index 000000000000..8b312f67a483 --- /dev/null +++ b/java-valkey/google-cloud-valkey/pom.xml @@ -0,0 +1,114 @@ + + + 4.0.0 + com.google.cloud + google-cloud-valkey + 0.0.1-SNAPSHOT + jar + Google Memorystore API + Memorystore API Memorystore for Valkey is a fully managed Valkey Cluster service for Google Cloud. + + com.google.cloud + google-cloud-valkey-parent + 0.0.1-SNAPSHOT + + + google-cloud-valkey + + + + 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-valkey-v1 + + + com.google.api.grpc + proto-google-cloud-valkey-v1beta + + + com.google.guava + guava + + + com.google.api + gax + + + com.google.api + gax-grpc + + + com.google.api + gax-httpjson + + + com.google.api.grpc + proto-google-iam-v1 + + + org.threeten + threetenbp + + + + + com.google.api.grpc + grpc-google-common-protos + test + + + com.google.api.grpc + grpc-google-iam-v1 + test + + + junit + junit + 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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/MemorystoreClient.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/MemorystoreClient.java new file mode 100644 index 000000000000..6c62b69053e3 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/MemorystoreClient.java @@ -0,0 +1,1506 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.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.memorystore.v1.stub.MemorystoreStub; +import com.google.cloud.memorystore.v1.stub.MemorystoreStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = memorystoreClient.getInstance(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the MemorystoreClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

ListInstances

Lists Instances in a given project and location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listInstances(ListInstancesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listInstances(LocationName parent) + *

  • listInstances(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listInstancesPagedCallable() + *

  • listInstancesCallable() + *

+ *

GetInstance

Gets details of a single Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getInstance(GetInstanceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getInstance(InstanceName name) + *

  • getInstance(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getInstanceCallable() + *

+ *

CreateInstance

Creates a new Instance in a given project and location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createInstanceAsync(CreateInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createInstanceAsync(LocationName parent, Instance instance, String instanceId) + *

  • createInstanceAsync(String parent, Instance instance, String instanceId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createInstanceOperationCallable() + *

  • createInstanceCallable() + *

+ *

UpdateInstance

Updates the parameters of a single Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateInstanceAsync(UpdateInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateInstanceAsync(Instance instance, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateInstanceOperationCallable() + *

  • updateInstanceCallable() + *

+ *

DeleteInstance

Deletes a single Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteInstanceAsync(DeleteInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deleteInstanceAsync(InstanceName name) + *

  • deleteInstanceAsync(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteInstanceOperationCallable() + *

  • deleteInstanceCallable() + *

+ *

GetCertificateAuthority

Gets details about the certificate authority for an Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getCertificateAuthority(GetCertificateAuthorityRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getCertificateAuthority(InstanceName name) + *

  • getCertificateAuthority(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getCertificateAuthorityCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 MemorystoreSettings 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
+ * MemorystoreSettings memorystoreSettings =
+ *     MemorystoreSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings);
+ * }
+ * + *

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
+ * MemorystoreSettings memorystoreSettings =
+ *     MemorystoreSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@Generated("by gapic-generator-java") +public class MemorystoreClient implements BackgroundResource { + private final MemorystoreSettings settings; + private final MemorystoreStub stub; + private final OperationsClient httpJsonOperationsClient; + + /** Constructs an instance of MemorystoreClient with default settings. */ + public static final MemorystoreClient create() throws IOException { + return create(MemorystoreSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MemorystoreClient, 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 MemorystoreClient create(MemorystoreSettings settings) throws IOException { + return new MemorystoreClient(settings); + } + + /** + * Constructs an instance of MemorystoreClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(MemorystoreSettings). + */ + public static final MemorystoreClient create(MemorystoreStub stub) { + return new MemorystoreClient(stub); + } + + /** + * Constructs an instance of MemorystoreClient, 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 MemorystoreClient(MemorystoreSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MemorystoreStubSettings) settings.getStubSettings()).createStub(); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected MemorystoreClient(MemorystoreStub stub) { + this.settings = null; + this.stub = stub; + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final MemorystoreSettings getSettings() { + return settings; + } + + public MemorystoreStub 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 OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent to list instances from. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(LocationName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent to list instances from. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Instance element : memorystoreClient.listInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(ListInstancesRequest request) { + return listInstancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       memorystoreClient.listInstancesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Instance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listInstancesPagedCallable() { + return stub.listInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListInstancesResponse response = memorystoreClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getInstancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Instance response = memorystoreClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the instance to retrieve. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   Instance response = memorystoreClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the instance to retrieve. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   Instance response = memorystoreClient.getInstance(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future = memorystoreClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this instance will be created. Format: + * projects/{project}/locations/{location} + * @param instance Required. The instance to create. + * @param instanceId Required. The ID to use for the instance, which will become the final + * component of the instance's resource name. + *

This value is subject to the following restrictions: + *

    + *
  • Must be 4-63 characters in length + *
  • Must begin with a letter or digit + *
  • Must contain only lowercase letters, digits, and hyphens + *
  • Must not end with a hyphen + *
  • Must be unique within a location + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + LocationName parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this instance will be created. Format: + * projects/{project}/locations/{location} + * @param instance Required. The instance to create. + * @param instanceId Required. The ID to use for the instance, which will become the final + * component of the instance's resource name. + *

This value is subject to the following restrictions: + *

    + *
  • Must be 4-63 characters in length + *
  • Must begin with a letter or digit + *
  • Must contain only lowercase letters, digits, and hyphens + *
  • Must not end with a hyphen + *
  • Must be unique within a location + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Instance response = memorystoreClient.createInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       memorystoreClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = memorystoreClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response = memorystoreClient.updateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Required. The instance to update. + * @param updateMask Optional. The list of fields to be updated on the instance. At least one + * field must be specified. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + Instance instance, FieldMask updateMask) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setInstance(instance).setUpdateMask(updateMask).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Instance response = memorystoreClient.updateInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   memorystoreClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the instance to delete. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   memorystoreClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the instance to delete. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   memorystoreClient.deleteInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = memorystoreClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   CertificateAuthority response = memorystoreClient.getCertificateAuthority(name);
+   * }
+   * }
+ * + * @param name Required. The name of the certificate authority. Format: + * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CertificateAuthority getCertificateAuthority(InstanceName name) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getCertificateAuthority(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   CertificateAuthority response = memorystoreClient.getCertificateAuthority(name);
+   * }
+   * }
+ * + * @param name Required. The name of the certificate authority. Format: + * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CertificateAuthority getCertificateAuthority(String name) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder().setName(name).build(); + return getCertificateAuthority(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetCertificateAuthorityRequest request =
+   *       GetCertificateAuthorityRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   CertificateAuthority response = memorystoreClient.getCertificateAuthority(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 CertificateAuthority getCertificateAuthority( + GetCertificateAuthorityRequest request) { + return getCertificateAuthorityCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetCertificateAuthorityRequest request =
+   *       GetCertificateAuthorityRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       memorystoreClient.getCertificateAuthorityCallable().futureCall(request);
+   *   // Do something.
+   *   CertificateAuthority response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getCertificateAuthorityCallable() { + return stub.getCertificateAuthorityCallable(); + } + + // 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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = memorystoreClient.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 ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListInstancesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class 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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/MemorystoreSettings.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/MemorystoreSettings.java new file mode 100644 index 000000000000..30b580bffc8e --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/MemorystoreSettings.java @@ -0,0 +1,346 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1; + +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.gax.core.GoogleCredentialsProvider; +import com.google.api.gax.core.InstantiatingExecutorProvider; +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.memorystore.v1.stub.MemorystoreStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MemorystoreClient}. + * + *

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

    + *
  • The default service address (memorystore.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder();
+ * memorystoreSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         memorystoreSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MemorystoreSettings memorystoreSettings = memorystoreSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * memorystoreSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class MemorystoreSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((MemorystoreStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).deleteInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings + getCertificateAuthoritySettings() { + return ((MemorystoreStubSettings) getStubSettings()).getCertificateAuthoritySettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MemorystoreStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final MemorystoreSettings create(MemorystoreStubSettings stub) throws IOException { + return new MemorystoreSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MemorystoreStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MemorystoreStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MemorystoreStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MemorystoreStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MemorystoreStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MemorystoreStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MemorystoreStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 MemorystoreSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MemorystoreSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MemorystoreStubSettings.newBuilder(clientContext)); + } + + protected Builder(MemorystoreSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MemorystoreStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MemorystoreStubSettings.newBuilder()); + } + + public MemorystoreStubSettings.Builder getStubSettingsBuilder() { + return ((MemorystoreStubSettings.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 listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings.Builder + getCertificateAuthoritySettings() { + return getStubSettingsBuilder().getCertificateAuthoritySettings(); + } + + /** 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 MemorystoreSettings build() throws IOException { + return new MemorystoreSettings(this); + } + } +} diff --git a/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/gapic_metadata.json b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/gapic_metadata.json new file mode 100644 index 000000000000..733b9ff56a58 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.memorystore.v1", + "libraryPackage": "com.google.cloud.memorystore.v1", + "services": { + "Memorystore": { + "clients": { + "grpc": { + "libraryClient": "MemorystoreClient", + "rpcs": { + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] + }, + "GetCertificateAuthority": { + "methods": ["getCertificateAuthority", "getCertificateAuthority", "getCertificateAuthority", "getCertificateAuthorityCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/package-info.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/package-info.java new file mode 100644 index 000000000000..165936cce804 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Memorystore API + * + *

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

======================= MemorystoreClient ======================= + * + *

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

Sample for MemorystoreClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = memorystoreClient.getInstance(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.memorystore.v1; + +import javax.annotation.Generated; diff --git a/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/HttpJsonMemorystoreCallableFactory.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/HttpJsonMemorystoreCallableFactory.java new file mode 100644 index 000000000000..20630bdac854 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/HttpJsonMemorystoreCallableFactory.java @@ -0,0 +1,101 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.stub; + +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 Memorystore service API. + * + *

This class is for advanced usage. + */ +@Generated("by gapic-generator-java") +public class HttpJsonMemorystoreCallableFactory + 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); + } + + @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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/HttpJsonMemorystoreStub.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/HttpJsonMemorystoreStub.java new file mode 100644 index 000000000000..f9f07ee1c06f --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/HttpJsonMemorystoreStub.java @@ -0,0 +1,736 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.stub; + +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListLocationsPagedResponse; + +import com.google.api.HttpRule; +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.memorystore.v1.CertificateAuthority; +import com.google.cloud.memorystore.v1.CreateInstanceRequest; +import com.google.cloud.memorystore.v1.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1.GetInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.ListInstancesRequest; +import com.google.cloud.memorystore.v1.ListInstancesResponse; +import com.google.cloud.memorystore.v1.OperationMetadata; +import com.google.cloud.memorystore.v1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Memorystore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public class HttpJsonMemorystoreStub extends MemorystoreStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Instance.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1.Memorystore/ListInstances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListInstancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1.Memorystore/GetInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Instance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1.Memorystore/CreateInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{parent=projects/*/locations/*}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1.Memorystore/UpdateInstance") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{instance.name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "instance.name", request.getInstance().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1.Memorystore/DeleteInstance") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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( + (DeleteInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getCertificateAuthorityMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1.Memorystore/GetCertificateAuthority") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*/instances/*}/certificateAuthority", + 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(CertificateAuthority.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable + getCertificateAuthorityCallable; + 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 HttpJsonMemorystoreStub create(MemorystoreStubSettings settings) + throws IOException { + return new HttpJsonMemorystoreStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMemorystoreStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonMemorystoreStub(MemorystoreStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonMemorystoreStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMemorystoreStub( + MemorystoreStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMemorystoreStub, 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 HttpJsonMemorystoreStub(MemorystoreStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMemorystoreCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMemorystoreStub, 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 HttpJsonMemorystoreStub( + MemorystoreStubSettings 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 + listInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance.name", String.valueOf(request.getInstance().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getCertificateAuthorityTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCertificateAuthorityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + 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.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getCertificateAuthorityCallable = + callableFactory.createUnaryCallable( + getCertificateAuthorityTransportSettings, + settings.getCertificateAuthoritySettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listInstancesMethodDescriptor); + methodDescriptors.add(getInstanceMethodDescriptor); + methodDescriptors.add(createInstanceMethodDescriptor); + methodDescriptors.add(updateInstanceMethodDescriptor); + methodDescriptors.add(deleteInstanceMethodDescriptor); + methodDescriptors.add(getCertificateAuthorityMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable + getCertificateAuthorityCallable() { + return getCertificateAuthorityCallable; + } + + @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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/MemorystoreStub.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/MemorystoreStub.java new file mode 100644 index 000000000000..c48fe944442c --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/MemorystoreStub.java @@ -0,0 +1,117 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.stub; + +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListLocationsPagedResponse; + +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +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.memorystore.v1.CertificateAuthority; +import com.google.cloud.memorystore.v1.CreateInstanceRequest; +import com.google.cloud.memorystore.v1.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1.GetInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.ListInstancesRequest; +import com.google.cloud.memorystore.v1.ListInstancesResponse; +import com.google.cloud.memorystore.v1.OperationMetadata; +import com.google.cloud.memorystore.v1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Memorystore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@Generated("by gapic-generator-java") +public abstract class MemorystoreStub implements BackgroundResource { + + public OperationsStub getHttpJsonOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getHttpJsonOperationsStub()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public UnaryCallable + getCertificateAuthorityCallable() { + throw new UnsupportedOperationException("Not implemented: getCertificateAuthorityCallable()"); + } + + 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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/MemorystoreStubSettings.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/MemorystoreStubSettings.java new file mode 100644 index 000000000000..e5eeddecd18e --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1/stub/MemorystoreStubSettings.java @@ -0,0 +1,772 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.stub; + +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.httpjson.ProtoOperationTransformers; +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.memorystore.v1.CertificateAuthority; +import com.google.cloud.memorystore.v1.CreateInstanceRequest; +import com.google.cloud.memorystore.v1.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1.GetInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.ListInstancesRequest; +import com.google.cloud.memorystore.v1.ListInstancesResponse; +import com.google.cloud.memorystore.v1.OperationMetadata; +import com.google.cloud.memorystore.v1.UpdateInstanceRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MemorystoreStub}. + * + *

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

    + *
  • The default service address (memorystore.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreStubSettings.Builder memorystoreSettingsBuilder =
+ *     MemorystoreStubSettings.newBuilder();
+ * memorystoreSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         memorystoreSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MemorystoreStubSettings memorystoreSettings = memorystoreSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreStubSettings.Builder memorystoreSettingsBuilder =
+ *     MemorystoreStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * memorystoreSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@Generated("by gapic-generator-java") +public class MemorystoreStubSettings 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< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + private final UnaryCallSettings + getCertificateAuthoritySettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList(); + } + }; + + 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(); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + 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 listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings + getCertificateAuthoritySettings() { + return getCertificateAuthoritySettings; + } + + /** 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 MemorystoreStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMemorystoreStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "memorystore"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "memorystore.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "memorystore.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 ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(MemorystoreStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 MemorystoreStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + getCertificateAuthoritySettings = settingsBuilder.getCertificateAuthoritySettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for MemorystoreStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + private final UnaryCallSettings.Builder + getCertificateAuthoritySettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + 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() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(10000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_1_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); + + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + getCertificateAuthoritySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + deleteInstanceSettings, + getCertificateAuthoritySettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(MemorystoreStubSettings settings) { + super(settings); + + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + getCertificateAuthoritySettings = settings.getCertificateAuthoritySettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + deleteInstanceSettings, + getCertificateAuthoritySettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getCertificateAuthoritySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_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 + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings.Builder + getCertificateAuthoritySettings() { + return getCertificateAuthoritySettings; + } + + /** 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 MemorystoreStubSettings build() throws IOException { + return new MemorystoreStubSettings(this); + } + } +} diff --git a/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/MemorystoreClient.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/MemorystoreClient.java new file mode 100644 index 000000000000..d77eb273f675 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/MemorystoreClient.java @@ -0,0 +1,1508 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta; + +import com.google.api.core.ApiFuture; +import com.google.api.core.ApiFutures; +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.OperationsClient; +import com.google.api.gax.longrunning.OperationFuture; +import com.google.api.gax.paging.AbstractFixedSizeCollection; +import com.google.api.gax.paging.AbstractPage; +import com.google.api.gax.paging.AbstractPagedListResponse; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PageContext; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.ListLocationsResponse; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1beta.stub.MemorystoreStub; +import com.google.cloud.memorystore.v1beta.stub.MemorystoreStubSettings; +import com.google.common.util.concurrent.MoreExecutors; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.FieldMask; +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Service Description: Service describing handlers for resources + * + *

This class provides the ability to make remote calls to the backing service through method + * calls that map to API methods. Sample code to get started: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = memorystoreClient.getInstance(name);
+ * }
+ * }
+ * + *

Note: close() needs to be called on the MemorystoreClient object to clean up resources such as + * threads. In the example above, try-with-resources is used, which automatically calls close(). + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Methods
MethodDescriptionMethod Variants

ListInstances

Lists Instances in a given project and location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listInstances(ListInstancesRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • listInstances(LocationName parent) + *

  • listInstances(String parent) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listInstancesPagedCallable() + *

  • listInstancesCallable() + *

+ *

GetInstance

Gets details of a single Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getInstance(GetInstanceRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getInstance(InstanceName name) + *

  • getInstance(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getInstanceCallable() + *

+ *

CreateInstance

Creates a new Instance in a given project and location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • createInstanceAsync(CreateInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • createInstanceAsync(LocationName parent, Instance instance, String instanceId) + *

  • createInstanceAsync(String parent, Instance instance, String instanceId) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • createInstanceOperationCallable() + *

  • createInstanceCallable() + *

+ *

UpdateInstance

Updates the parameters of a single Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • updateInstanceAsync(UpdateInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • updateInstanceAsync(Instance instance, FieldMask updateMask) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • updateInstanceOperationCallable() + *

  • updateInstanceCallable() + *

+ *

DeleteInstance

Deletes a single Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • deleteInstanceAsync(DeleteInstanceRequest request) + *

+ *

Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.

+ *
    + *
  • deleteInstanceAsync(InstanceName name) + *

  • deleteInstanceAsync(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • deleteInstanceOperationCallable() + *

  • deleteInstanceCallable() + *

+ *

GetCertificateAuthority

Gets details about the certificate authority for an Instance.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getCertificateAuthority(GetCertificateAuthorityRequest request) + *

+ *

"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

+ *
    + *
  • getCertificateAuthority(InstanceName name) + *

  • getCertificateAuthority(String name) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getCertificateAuthorityCallable() + *

+ *

ListLocations

Lists information about the supported locations for this service.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • listLocations(ListLocationsRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • listLocationsPagedCallable() + *

  • listLocationsCallable() + *

+ *

GetLocation

Gets information about a location.

+ *

Request object method variants only take one parameter, a request object, which must be constructed before the call.

+ *
    + *
  • getLocation(GetLocationRequest request) + *

+ *

Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

+ *
    + *
  • getLocationCallable() + *

+ *
+ * + *

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 MemorystoreSettings 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
+ * MemorystoreSettings memorystoreSettings =
+ *     MemorystoreSettings.newBuilder()
+ *         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
+ *         .build();
+ * MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings);
+ * }
+ * + *

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
+ * MemorystoreSettings memorystoreSettings =
+ *     MemorystoreSettings.newBuilder().setEndpoint(myEndpoint).build();
+ * MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings);
+ * }
+ * + *

Please refer to the GitHub repository's samples for more quickstart code snippets. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class MemorystoreClient implements BackgroundResource { + private final MemorystoreSettings settings; + private final MemorystoreStub stub; + private final OperationsClient httpJsonOperationsClient; + + /** Constructs an instance of MemorystoreClient with default settings. */ + public static final MemorystoreClient create() throws IOException { + return create(MemorystoreSettings.newBuilder().build()); + } + + /** + * Constructs an instance of MemorystoreClient, 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 MemorystoreClient create(MemorystoreSettings settings) throws IOException { + return new MemorystoreClient(settings); + } + + /** + * Constructs an instance of MemorystoreClient, using the given stub for making calls. This is for + * advanced usage - prefer using create(MemorystoreSettings). + */ + public static final MemorystoreClient create(MemorystoreStub stub) { + return new MemorystoreClient(stub); + } + + /** + * Constructs an instance of MemorystoreClient, 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 MemorystoreClient(MemorystoreSettings settings) throws IOException { + this.settings = settings; + this.stub = ((MemorystoreStubSettings) settings.getStubSettings()).createStub(); + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + protected MemorystoreClient(MemorystoreStub stub) { + this.settings = null; + this.stub = stub; + this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub()); + } + + public final MemorystoreSettings getSettings() { + return settings; + } + + public MemorystoreStub 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 OperationsClient getHttpJsonOperationsClient() { + return httpJsonOperationsClient; + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent to list instances from. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(LocationName parent) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param parent Required. The parent to list instances from. Format: + * projects/{project}/locations/{location} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(String parent) { + ListInstancesRequest request = ListInstancesRequest.newBuilder().setParent(parent).build(); + return listInstances(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   for (Instance element : memorystoreClient.listInstances(request).iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final ListInstancesPagedResponse listInstances(ListInstancesRequest request) { + return listInstancesPagedCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   ApiFuture future =
+   *       memorystoreClient.listInstancesPagedCallable().futureCall(request);
+   *   // Do something.
+   *   for (Instance element : future.get().iterateAll()) {
+   *     // doThingsWith(element);
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable + listInstancesPagedCallable() { + return stub.listInstancesPagedCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Lists Instances in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListInstancesRequest request =
+   *       ListInstancesRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .setFilter("filter-1274492040")
+   *           .setOrderBy("orderBy-1207110587")
+   *           .build();
+   *   while (true) {
+   *     ListInstancesResponse response = memorystoreClient.listInstancesCallable().call(request);
+   *     for (Instance element : response.getInstancesList()) {
+   *       // doThingsWith(element);
+   *     }
+   *     String nextPageToken = response.getNextPageToken();
+   *     if (!Strings.isNullOrEmpty(nextPageToken)) {
+   *       request = request.toBuilder().setPageToken(nextPageToken).build();
+   *     } else {
+   *       break;
+   *     }
+   *   }
+   * }
+   * }
+ */ + public final UnaryCallable listInstancesCallable() { + return stub.listInstancesCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   Instance response = memorystoreClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the instance to retrieve. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(InstanceName name) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   Instance response = memorystoreClient.getInstance(name);
+   * }
+   * }
+ * + * @param name Required. The name of the instance to retrieve. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(String name) { + GetInstanceRequest request = GetInstanceRequest.newBuilder().setName(name).build(); + return getInstance(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   Instance response = memorystoreClient.getInstance(request);
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final Instance getInstance(GetInstanceRequest request) { + return getInstanceCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetInstanceRequest request =
+   *       GetInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future = memorystoreClient.getInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable getInstanceCallable() { + return stub.getInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this instance will be created. Format: + * projects/{project}/locations/{location} + * @param instance Required. The instance to create. + * @param instanceId Required. The ID to use for the instance, which will become the final + * component of the instance's resource name. + *

This value is subject to the following restrictions: + *

    + *
  • Must be 4-63 characters in length + *
  • Must begin with a letter or digit + *
  • Must contain only lowercase letters, digits, and hyphens + *
  • Must not end with a hyphen + *
  • Must be unique within a location + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + LocationName parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent == null ? null : parent.toString()) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
+   *   Instance instance = Instance.newBuilder().build();
+   *   String instanceId = "instanceId902024336";
+   *   Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get();
+   * }
+   * }
+ * + * @param parent Required. The parent resource where this instance will be created. Format: + * projects/{project}/locations/{location} + * @param instance Required. The instance to create. + * @param instanceId Required. The ID to use for the instance, which will become the final + * component of the instance's resource name. + *

This value is subject to the following restrictions: + *

    + *
  • Must be 4-63 characters in length + *
  • Must begin with a letter or digit + *
  • Must contain only lowercase letters, digits, and hyphens + *
  • Must not end with a hyphen + *
  • Must be unique within a location + *
+ * + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + String parent, Instance instance, String instanceId) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(parent) + .setInstance(instance) + .setInstanceId(instanceId) + .build(); + return createInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Instance response = memorystoreClient.createInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture createInstanceAsync( + CreateInstanceRequest request) { + return createInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   OperationFuture future =
+   *       memorystoreClient.createInstanceOperationCallable().futureCall(request);
+   *   // Do something.
+   *   Instance response = future.get();
+   * }
+   * }
+ */ + public final OperationCallable + createInstanceOperationCallable() { + return stub.createInstanceOperationCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Creates a new Instance in a given project and location. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   CreateInstanceRequest request =
+   *       CreateInstanceRequest.newBuilder()
+   *           .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
+   *           .setInstanceId("instanceId902024336")
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = memorystoreClient.createInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   Operation response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable createInstanceCallable() { + return stub.createInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   Instance instance = Instance.newBuilder().build();
+   *   FieldMask updateMask = FieldMask.newBuilder().build();
+   *   Instance response = memorystoreClient.updateInstanceAsync(instance, updateMask).get();
+   * }
+   * }
+ * + * @param instance Required. The instance to update. + * @param updateMask Optional. The list of fields to be updated on the instance. At least one + * field must be specified. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + Instance instance, FieldMask updateMask) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder().setInstance(instance).setUpdateMask(updateMask).build(); + return updateInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   UpdateInstanceRequest request =
+   *       UpdateInstanceRequest.newBuilder()
+   *           .setUpdateMask(FieldMask.newBuilder().build())
+   *           .setInstance(Instance.newBuilder().build())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   Instance response = memorystoreClient.updateInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture updateInstanceAsync( + UpdateInstanceRequest request) { + return updateInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Updates the parameters of a single Instance. + * + *

Sample code: + * + *

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

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   memorystoreClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the instance to delete. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(InstanceName name) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder().setName(name == null ? null : name.toString()).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   memorystoreClient.deleteInstanceAsync(name).get();
+   * }
+   * }
+ * + * @param name Required. The name of the instance to delete. Format: + * projects/{project}/locations/{location}/instances/{instance} + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync(String name) { + DeleteInstanceRequest request = DeleteInstanceRequest.newBuilder().setName(name).build(); + return deleteInstanceAsync(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   memorystoreClient.deleteInstanceAsync(request).get();
+   * }
+   * }
+ * + * @param request The request object containing all of the parameters for the API call. + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final OperationFuture deleteInstanceAsync( + DeleteInstanceRequest request) { + return deleteInstanceOperationCallable().futureCall(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Deletes a single Instance. + * + *

Sample code: + * + *

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

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   DeleteInstanceRequest request =
+   *       DeleteInstanceRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .setRequestId("requestId693933066")
+   *           .build();
+   *   ApiFuture future = memorystoreClient.deleteInstanceCallable().futureCall(request);
+   *   // Do something.
+   *   future.get();
+   * }
+   * }
+ */ + public final UnaryCallable deleteInstanceCallable() { + return stub.deleteInstanceCallable(); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+   *   CertificateAuthority response = memorystoreClient.getCertificateAuthority(name);
+   * }
+   * }
+ * + * @param name Required. The name of the certificate authority. Format: + * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CertificateAuthority getCertificateAuthority(InstanceName name) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder() + .setName(name == null ? null : name.toString()) + .build(); + return getCertificateAuthority(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString();
+   *   CertificateAuthority response = memorystoreClient.getCertificateAuthority(name);
+   * }
+   * }
+ * + * @param name Required. The name of the certificate authority. Format: + * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority + * @throws com.google.api.gax.rpc.ApiException if the remote call fails + */ + public final CertificateAuthority getCertificateAuthority(String name) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder().setName(name).build(); + return getCertificateAuthority(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetCertificateAuthorityRequest request =
+   *       GetCertificateAuthorityRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   CertificateAuthority response = memorystoreClient.getCertificateAuthority(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 CertificateAuthority getCertificateAuthority( + GetCertificateAuthorityRequest request) { + return getCertificateAuthorityCallable().call(request); + } + + // AUTO-GENERATED DOCUMENTATION AND METHOD. + /** + * Gets details about the certificate authority for an Instance. + * + *

Sample code: + * + *

{@code
+   * // This snippet has been automatically generated and should be regarded as a code template only.
+   * // It will require modifications to work:
+   * // - It may require correct/in-range values for request initialization.
+   * // - It may require specifying regional endpoints when creating the service client as shown in
+   * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+   * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetCertificateAuthorityRequest request =
+   *       GetCertificateAuthorityRequest.newBuilder()
+   *           .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString())
+   *           .build();
+   *   ApiFuture future =
+   *       memorystoreClient.getCertificateAuthorityCallable().futureCall(request);
+   *   // Do something.
+   *   CertificateAuthority response = future.get();
+   * }
+   * }
+ */ + public final UnaryCallable + getCertificateAuthorityCallable() { + return stub.getCertificateAuthorityCallable(); + } + + // 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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   for (Location element : memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   ApiFuture future =
+   *       memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   ListLocationsRequest request =
+   *       ListLocationsRequest.newBuilder()
+   *           .setName("name3373707")
+   *           .setFilter("filter-1274492040")
+   *           .setPageSize(883849137)
+   *           .setPageToken("pageToken873572522")
+   *           .build();
+   *   while (true) {
+   *     ListLocationsResponse response = memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   Location response = memorystoreClient.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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+   *   GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
+   *   ApiFuture future = memorystoreClient.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 ListInstancesPagedResponse + extends AbstractPagedListResponse< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + public static ApiFuture createAsync( + PageContext context, + ApiFuture futureResponse) { + ApiFuture futurePage = + ListInstancesPage.createEmptyPage().createPageAsync(context, futureResponse); + return ApiFutures.transform( + futurePage, + input -> new ListInstancesPagedResponse(input), + MoreExecutors.directExecutor()); + } + + private ListInstancesPagedResponse(ListInstancesPage page) { + super(page, ListInstancesFixedSizeCollection.createEmptyCollection()); + } + } + + public static class ListInstancesPage + extends AbstractPage< + ListInstancesRequest, ListInstancesResponse, Instance, ListInstancesPage> { + + private ListInstancesPage( + PageContext context, + ListInstancesResponse response) { + super(context, response); + } + + private static ListInstancesPage createEmptyPage() { + return new ListInstancesPage(null, null); + } + + @Override + protected ListInstancesPage createPage( + PageContext context, + ListInstancesResponse response) { + return new ListInstancesPage(context, response); + } + + @Override + public ApiFuture createPageAsync( + PageContext context, + ApiFuture futureResponse) { + return super.createPageAsync(context, futureResponse); + } + } + + public static class ListInstancesFixedSizeCollection + extends AbstractFixedSizeCollection< + ListInstancesRequest, + ListInstancesResponse, + Instance, + ListInstancesPage, + ListInstancesFixedSizeCollection> { + + private ListInstancesFixedSizeCollection(List pages, int collectionSize) { + super(pages, collectionSize); + } + + private static ListInstancesFixedSizeCollection createEmptyCollection() { + return new ListInstancesFixedSizeCollection(null, 0); + } + + @Override + protected ListInstancesFixedSizeCollection createCollection( + List pages, int collectionSize) { + return new ListInstancesFixedSizeCollection(pages, collectionSize); + } + } + + public static class 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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/MemorystoreSettings.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/MemorystoreSettings.java new file mode 100644 index 000000000000..46b7dee3e1cc --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/MemorystoreSettings.java @@ -0,0 +1,348 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta; + +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.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.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.memorystore.v1beta.stub.MemorystoreStubSettings; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MemorystoreClient}. + * + *

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

    + *
  • The default service address (memorystore.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder();
+ * memorystoreSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         memorystoreSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MemorystoreSettings memorystoreSettings = memorystoreSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * memorystoreSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class MemorystoreSettings extends ClientSettings { + + /** Returns the object with the settings used for calls to listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return ((MemorystoreStubSettings) getStubSettings()).listInstancesSettings(); + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).getInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).createInstanceSettings(); + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).createInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).updateInstanceSettings(); + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).updateInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return ((MemorystoreStubSettings) getStubSettings()).deleteInstanceSettings(); + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).deleteInstanceOperationSettings(); + } + + /** Returns the object with the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings + getCertificateAuthoritySettings() { + return ((MemorystoreStubSettings) getStubSettings()).getCertificateAuthoritySettings(); + } + + /** Returns the object with the settings used for calls to listLocations. */ + public PagedCallSettings + listLocationsSettings() { + return ((MemorystoreStubSettings) getStubSettings()).listLocationsSettings(); + } + + /** Returns the object with the settings used for calls to getLocation. */ + public UnaryCallSettings getLocationSettings() { + return ((MemorystoreStubSettings) getStubSettings()).getLocationSettings(); + } + + public static final MemorystoreSettings create(MemorystoreStubSettings stub) throws IOException { + return new MemorystoreSettings.Builder(stub.toBuilder()).build(); + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return MemorystoreStubSettings.defaultExecutorProviderBuilder(); + } + + /** Returns the default service endpoint. */ + public static String getDefaultEndpoint() { + return MemorystoreStubSettings.getDefaultEndpoint(); + } + + /** Returns the default service scopes. */ + public static List getDefaultServiceScopes() { + return MemorystoreStubSettings.getDefaultServiceScopes(); + } + + /** Returns a builder for the default credentials for this service. */ + public static GoogleCredentialsProvider.Builder defaultCredentialsProviderBuilder() { + return MemorystoreStubSettings.defaultCredentialsProviderBuilder(); + } + + /** Returns a builder for the default ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return MemorystoreStubSettings.defaultHttpJsonTransportProviderBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return MemorystoreStubSettings.defaultTransportChannelProvider(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return MemorystoreStubSettings.defaultApiClientHeaderProviderBuilder(); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 MemorystoreSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + } + + /** Builder for MemorystoreSettings. */ + public static class Builder extends ClientSettings.Builder { + + protected Builder() throws IOException { + this(((ClientContext) null)); + } + + protected Builder(ClientContext clientContext) { + super(MemorystoreStubSettings.newBuilder(clientContext)); + } + + protected Builder(MemorystoreSettings settings) { + super(settings.getStubSettings().toBuilder()); + } + + protected Builder(MemorystoreStubSettings.Builder stubSettings) { + super(stubSettings); + } + + private static Builder createDefault() { + return new Builder(MemorystoreStubSettings.newBuilder()); + } + + public MemorystoreStubSettings.Builder getStubSettingsBuilder() { + return ((MemorystoreStubSettings.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 listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return getStubSettingsBuilder().listInstancesSettings(); + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getStubSettingsBuilder().getInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return getStubSettingsBuilder().createInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return getStubSettingsBuilder().createInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return getStubSettingsBuilder().updateInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return getStubSettingsBuilder().updateInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return getStubSettingsBuilder().deleteInstanceSettings(); + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return getStubSettingsBuilder().deleteInstanceOperationSettings(); + } + + /** Returns the builder for the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings.Builder + getCertificateAuthoritySettings() { + return getStubSettingsBuilder().getCertificateAuthoritySettings(); + } + + /** 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 MemorystoreSettings build() throws IOException { + return new MemorystoreSettings(this); + } + } +} diff --git a/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/gapic_metadata.json b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/gapic_metadata.json new file mode 100644 index 000000000000..9a898c2a60af --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/gapic_metadata.json @@ -0,0 +1,42 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "java", + "protoPackage": "google.cloud.memorystore.v1beta", + "libraryPackage": "com.google.cloud.memorystore.v1beta", + "services": { + "Memorystore": { + "clients": { + "grpc": { + "libraryClient": "MemorystoreClient", + "rpcs": { + "CreateInstance": { + "methods": ["createInstanceAsync", "createInstanceAsync", "createInstanceAsync", "createInstanceOperationCallable", "createInstanceCallable"] + }, + "DeleteInstance": { + "methods": ["deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceAsync", "deleteInstanceOperationCallable", "deleteInstanceCallable"] + }, + "GetCertificateAuthority": { + "methods": ["getCertificateAuthority", "getCertificateAuthority", "getCertificateAuthority", "getCertificateAuthorityCallable"] + }, + "GetInstance": { + "methods": ["getInstance", "getInstance", "getInstance", "getInstanceCallable"] + }, + "GetLocation": { + "methods": ["getLocation", "getLocationCallable"] + }, + "ListInstances": { + "methods": ["listInstances", "listInstances", "listInstances", "listInstancesPagedCallable", "listInstancesCallable"] + }, + "ListLocations": { + "methods": ["listLocations", "listLocationsPagedCallable", "listLocationsCallable"] + }, + "UpdateInstance": { + "methods": ["updateInstanceAsync", "updateInstanceAsync", "updateInstanceOperationCallable", "updateInstanceCallable"] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/package-info.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/package-info.java new file mode 100644 index 000000000000..9c765debde47 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/package-info.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT 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 Memorystore API + * + *

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

======================= MemorystoreClient ======================= + * + *

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

Sample for MemorystoreClient: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) {
+ *   InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]");
+ *   Instance response = memorystoreClient.getInstance(name);
+ * }
+ * }
+ */ +@Generated("by gapic-generator-java") +package com.google.cloud.memorystore.v1beta; + +import javax.annotation.Generated; diff --git a/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/HttpJsonMemorystoreCallableFactory.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/HttpJsonMemorystoreCallableFactory.java new file mode 100644 index 000000000000..850d5f3e0a00 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/HttpJsonMemorystoreCallableFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.stub; + +import com.google.api.core.BetaApi; +import com.google.api.gax.httpjson.HttpJsonCallSettings; +import com.google.api.gax.httpjson.HttpJsonCallableFactory; +import com.google.api.gax.httpjson.HttpJsonOperationSnapshotCallable; +import com.google.api.gax.httpjson.HttpJsonStubCallableFactory; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +import com.google.api.gax.rpc.BatchingCallSettings; +import com.google.api.gax.rpc.ClientContext; +import com.google.api.gax.rpc.OperationCallSettings; +import com.google.api.gax.rpc.OperationCallable; +import com.google.api.gax.rpc.PagedCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallSettings; +import com.google.api.gax.rpc.ServerStreamingCallable; +import com.google.api.gax.rpc.UnaryCallSettings; +import com.google.api.gax.rpc.UnaryCallable; +import com.google.longrunning.Operation; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST callable factory implementation for the Memorystore service API. + * + *

This class is for advanced usage. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMemorystoreCallableFactory + 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); + } + + @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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/HttpJsonMemorystoreStub.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/HttpJsonMemorystoreStub.java new file mode 100644 index 000000000000..5d45801d1ae6 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/HttpJsonMemorystoreStub.java @@ -0,0 +1,739 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.stub; + +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.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.memorystore.v1beta.CertificateAuthority; +import com.google.cloud.memorystore.v1beta.CreateInstanceRequest; +import com.google.cloud.memorystore.v1beta.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1beta.GetInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.ListInstancesRequest; +import com.google.cloud.memorystore.v1beta.ListInstancesResponse; +import com.google.cloud.memorystore.v1beta.OperationMetadata; +import com.google.cloud.memorystore.v1beta.UpdateInstanceRequest; +import com.google.common.collect.ImmutableMap; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import com.google.protobuf.TypeRegistry; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * REST stub implementation for the Memorystore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public class HttpJsonMemorystoreStub extends MemorystoreStub { + private static final TypeRegistry typeRegistry = + TypeRegistry.newBuilder() + .add(Empty.getDescriptor()) + .add(Instance.getDescriptor()) + .add(OperationMetadata.getDescriptor()) + .build(); + + private static final ApiMethodDescriptor + listInstancesMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1beta.Memorystore/ListInstances") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "filter", request.getFilter()); + serializer.putQueryParam(fields, "orderBy", request.getOrderBy()); + serializer.putQueryParam(fields, "pageSize", request.getPageSize()); + serializer.putQueryParam(fields, "pageToken", request.getPageToken()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListInstancesResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1beta.Memorystore/GetInstance") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Instance.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + createInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1beta.Memorystore/CreateInstance") + .setHttpMethod("POST") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{parent=projects/*/locations/*}/instances", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "parent", request.getParent()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "instanceId", request.getInstanceId()); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (CreateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + updateInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1beta.Memorystore/UpdateInstance") + .setHttpMethod("PATCH") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{instance.name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam( + fields, "instance.name", request.getInstance().getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "requestId", request.getRequestId()); + serializer.putQueryParam(fields, "updateMask", request.getUpdateMask()); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor( + request -> + ProtoRestSerializer.create() + .toBody("instance", request.getInstance(), true)) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Operation.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .setOperationSnapshotFactory( + (UpdateInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + deleteInstanceMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.memorystore.v1beta.Memorystore/DeleteInstance") + .setHttpMethod("DELETE") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/instances/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "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( + (DeleteInstanceRequest request, Operation response) -> + HttpJsonOperationSnapshot.create(response)) + .build(); + + private static final ApiMethodDescriptor + getCertificateAuthorityMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName( + "google.cloud.memorystore.v1beta.Memorystore/GetCertificateAuthority") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*/instances/*}/certificateAuthority", + 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(CertificateAuthority.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + listLocationsMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/ListLocations") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*}/locations", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(ListLocationsResponse.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private static final ApiMethodDescriptor + getLocationMethodDescriptor = + ApiMethodDescriptor.newBuilder() + .setFullMethodName("google.cloud.location.Locations/GetLocation") + .setHttpMethod("GET") + .setType(ApiMethodDescriptor.MethodType.UNARY) + .setRequestFormatter( + ProtoMessageRequestFormatter.newBuilder() + .setPath( + "/v1beta/{name=projects/*/locations/*}", + request -> { + Map fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putPathParam(fields, "name", request.getName()); + return fields; + }) + .setQueryParamsExtractor( + request -> { + Map> fields = new HashMap<>(); + ProtoRestSerializer serializer = + ProtoRestSerializer.create(); + serializer.putQueryParam(fields, "$alt", "json;enum-encoding=int"); + return fields; + }) + .setRequestBodyExtractor(request -> null) + .build()) + .setResponseParser( + ProtoMessageResponseParser.newBuilder() + .setDefaultInstance(Location.getDefaultInstance()) + .setDefaultTypeRegistry(typeRegistry) + .build()) + .build(); + + private final UnaryCallable listInstancesCallable; + private final UnaryCallable + listInstancesPagedCallable; + private final UnaryCallable getInstanceCallable; + private final UnaryCallable createInstanceCallable; + private final OperationCallable + createInstanceOperationCallable; + private final UnaryCallable updateInstanceCallable; + private final OperationCallable + updateInstanceOperationCallable; + private final UnaryCallable deleteInstanceCallable; + private final OperationCallable + deleteInstanceOperationCallable; + private final UnaryCallable + getCertificateAuthorityCallable; + 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 HttpJsonMemorystoreStub create(MemorystoreStubSettings settings) + throws IOException { + return new HttpJsonMemorystoreStub(settings, ClientContext.create(settings)); + } + + public static final HttpJsonMemorystoreStub create(ClientContext clientContext) + throws IOException { + return new HttpJsonMemorystoreStub(MemorystoreStubSettings.newBuilder().build(), clientContext); + } + + public static final HttpJsonMemorystoreStub create( + ClientContext clientContext, HttpJsonStubCallableFactory callableFactory) throws IOException { + return new HttpJsonMemorystoreStub( + MemorystoreStubSettings.newBuilder().build(), clientContext, callableFactory); + } + + /** + * Constructs an instance of HttpJsonMemorystoreStub, 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 HttpJsonMemorystoreStub(MemorystoreStubSettings settings, ClientContext clientContext) + throws IOException { + this(settings, clientContext, new HttpJsonMemorystoreCallableFactory()); + } + + /** + * Constructs an instance of HttpJsonMemorystoreStub, 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 HttpJsonMemorystoreStub( + MemorystoreStubSettings 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("/v1beta/{name=projects/*/locations/*/operations/*}:cancel") + .build()) + .put( + "google.longrunning.Operations.DeleteOperation", + HttpRule.newBuilder() + .setDelete("/v1beta/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.GetOperation", + HttpRule.newBuilder() + .setGet("/v1beta/{name=projects/*/locations/*/operations/*}") + .build()) + .put( + "google.longrunning.Operations.ListOperations", + HttpRule.newBuilder() + .setGet("/v1beta/{name=projects/*/locations/*}/operations") + .build()) + .build()); + + HttpJsonCallSettings + listInstancesTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(listInstancesMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings getInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings createInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(createInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("parent", String.valueOf(request.getParent())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings updateInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(updateInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("instance.name", String.valueOf(request.getInstance().getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings deleteInstanceTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(deleteInstanceMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + return builder.build(); + }) + .build(); + HttpJsonCallSettings + getCertificateAuthorityTransportSettings = + HttpJsonCallSettings.newBuilder() + .setMethodDescriptor(getCertificateAuthorityMethodDescriptor) + .setTypeRegistry(typeRegistry) + .setParamsExtractor( + request -> { + RequestParamsBuilder builder = RequestParamsBuilder.create(); + builder.add("name", String.valueOf(request.getName())); + 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.listInstancesCallable = + callableFactory.createUnaryCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.listInstancesPagedCallable = + callableFactory.createPagedCallable( + listInstancesTransportSettings, settings.listInstancesSettings(), clientContext); + this.getInstanceCallable = + callableFactory.createUnaryCallable( + getInstanceTransportSettings, settings.getInstanceSettings(), clientContext); + this.createInstanceCallable = + callableFactory.createUnaryCallable( + createInstanceTransportSettings, settings.createInstanceSettings(), clientContext); + this.createInstanceOperationCallable = + callableFactory.createOperationCallable( + createInstanceTransportSettings, + settings.createInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.updateInstanceCallable = + callableFactory.createUnaryCallable( + updateInstanceTransportSettings, settings.updateInstanceSettings(), clientContext); + this.updateInstanceOperationCallable = + callableFactory.createOperationCallable( + updateInstanceTransportSettings, + settings.updateInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.deleteInstanceCallable = + callableFactory.createUnaryCallable( + deleteInstanceTransportSettings, settings.deleteInstanceSettings(), clientContext); + this.deleteInstanceOperationCallable = + callableFactory.createOperationCallable( + deleteInstanceTransportSettings, + settings.deleteInstanceOperationSettings(), + clientContext, + httpJsonOperationsStub); + this.getCertificateAuthorityCallable = + callableFactory.createUnaryCallable( + getCertificateAuthorityTransportSettings, + settings.getCertificateAuthoritySettings(), + clientContext); + this.listLocationsCallable = + callableFactory.createUnaryCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.listLocationsPagedCallable = + callableFactory.createPagedCallable( + listLocationsTransportSettings, settings.listLocationsSettings(), clientContext); + this.getLocationCallable = + callableFactory.createUnaryCallable( + getLocationTransportSettings, settings.getLocationSettings(), clientContext); + + this.backgroundResources = + new BackgroundResourceAggregation(clientContext.getBackgroundResources()); + } + + @InternalApi + public static List getMethodDescriptors() { + List methodDescriptors = new ArrayList<>(); + methodDescriptors.add(listInstancesMethodDescriptor); + methodDescriptors.add(getInstanceMethodDescriptor); + methodDescriptors.add(createInstanceMethodDescriptor); + methodDescriptors.add(updateInstanceMethodDescriptor); + methodDescriptors.add(deleteInstanceMethodDescriptor); + methodDescriptors.add(getCertificateAuthorityMethodDescriptor); + methodDescriptors.add(listLocationsMethodDescriptor); + methodDescriptors.add(getLocationMethodDescriptor); + return methodDescriptors; + } + + public HttpJsonOperationsStub getHttpJsonOperationsStub() { + return httpJsonOperationsStub; + } + + @Override + public UnaryCallable listInstancesCallable() { + return listInstancesCallable; + } + + @Override + public UnaryCallable + listInstancesPagedCallable() { + return listInstancesPagedCallable; + } + + @Override + public UnaryCallable getInstanceCallable() { + return getInstanceCallable; + } + + @Override + public UnaryCallable createInstanceCallable() { + return createInstanceCallable; + } + + @Override + public OperationCallable + createInstanceOperationCallable() { + return createInstanceOperationCallable; + } + + @Override + public UnaryCallable updateInstanceCallable() { + return updateInstanceCallable; + } + + @Override + public OperationCallable + updateInstanceOperationCallable() { + return updateInstanceOperationCallable; + } + + @Override + public UnaryCallable deleteInstanceCallable() { + return deleteInstanceCallable; + } + + @Override + public OperationCallable + deleteInstanceOperationCallable() { + return deleteInstanceOperationCallable; + } + + @Override + public UnaryCallable + getCertificateAuthorityCallable() { + return getCertificateAuthorityCallable; + } + + @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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/MemorystoreStub.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/MemorystoreStub.java new file mode 100644 index 000000000000..ca042ebdbc2c --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/MemorystoreStub.java @@ -0,0 +1,119 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.stub; + +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.ListLocationsPagedResponse; + +import com.google.api.core.BetaApi; +import com.google.api.gax.core.BackgroundResource; +import com.google.api.gax.httpjson.longrunning.stub.OperationsStub; +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.memorystore.v1beta.CertificateAuthority; +import com.google.cloud.memorystore.v1beta.CreateInstanceRequest; +import com.google.cloud.memorystore.v1beta.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1beta.GetInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.ListInstancesRequest; +import com.google.cloud.memorystore.v1beta.ListInstancesResponse; +import com.google.cloud.memorystore.v1beta.OperationMetadata; +import com.google.cloud.memorystore.v1beta.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Base stub class for the Memorystore service API. + * + *

This class is for advanced usage and reflects the underlying API directly. + */ +@BetaApi +@Generated("by gapic-generator-java") +public abstract class MemorystoreStub implements BackgroundResource { + + public OperationsStub getHttpJsonOperationsStub() { + throw new UnsupportedOperationException("Not implemented: getHttpJsonOperationsStub()"); + } + + public UnaryCallable + listInstancesPagedCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesPagedCallable()"); + } + + public UnaryCallable listInstancesCallable() { + throw new UnsupportedOperationException("Not implemented: listInstancesCallable()"); + } + + public UnaryCallable getInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: getInstanceCallable()"); + } + + public OperationCallable + createInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceOperationCallable()"); + } + + public UnaryCallable createInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: createInstanceCallable()"); + } + + public OperationCallable + updateInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceOperationCallable()"); + } + + public UnaryCallable updateInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: updateInstanceCallable()"); + } + + public OperationCallable + deleteInstanceOperationCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceOperationCallable()"); + } + + public UnaryCallable deleteInstanceCallable() { + throw new UnsupportedOperationException("Not implemented: deleteInstanceCallable()"); + } + + public UnaryCallable + getCertificateAuthorityCallable() { + throw new UnsupportedOperationException("Not implemented: getCertificateAuthorityCallable()"); + } + + 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-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/MemorystoreStubSettings.java b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/MemorystoreStubSettings.java new file mode 100644 index 000000000000..770aef2ed493 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/java/com/google/cloud/memorystore/v1beta/stub/MemorystoreStubSettings.java @@ -0,0 +1,774 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.stub; + +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.ListLocationsPagedResponse; + +import com.google.api.core.ApiFunction; +import com.google.api.core.ApiFuture; +import com.google.api.core.BetaApi; +import com.google.api.core.ObsoleteApi; +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.httpjson.GaxHttpJsonProperties; +import com.google.api.gax.httpjson.HttpJsonTransportChannel; +import com.google.api.gax.httpjson.InstantiatingHttpJsonChannelProvider; +import com.google.api.gax.httpjson.ProtoOperationTransformers; +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.memorystore.v1beta.CertificateAuthority; +import com.google.cloud.memorystore.v1beta.CreateInstanceRequest; +import com.google.cloud.memorystore.v1beta.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1beta.GetInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.ListInstancesRequest; +import com.google.cloud.memorystore.v1beta.ListInstancesResponse; +import com.google.cloud.memorystore.v1beta.OperationMetadata; +import com.google.cloud.memorystore.v1beta.UpdateInstanceRequest; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Lists; +import com.google.longrunning.Operation; +import com.google.protobuf.Empty; +import java.io.IOException; +import java.time.Duration; +import java.util.List; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +/** + * Settings class to configure an instance of {@link MemorystoreStub}. + * + *

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

    + *
  • The default service address (memorystore.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 + * [RetrySettings](https://cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.retrying.RetrySettings) + * of getInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreStubSettings.Builder memorystoreSettingsBuilder =
+ *     MemorystoreStubSettings.newBuilder();
+ * memorystoreSettingsBuilder
+ *     .getInstanceSettings()
+ *     .setRetrySettings(
+ *         memorystoreSettingsBuilder
+ *             .getInstanceSettings()
+ *             .getRetrySettings()
+ *             .toBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofSeconds(1))
+ *             .setInitialRpcTimeoutDuration(Duration.ofSeconds(5))
+ *             .setMaxAttempts(5)
+ *             .setMaxRetryDelayDuration(Duration.ofSeconds(30))
+ *             .setMaxRpcTimeoutDuration(Duration.ofSeconds(60))
+ *             .setRetryDelayMultiplier(1.3)
+ *             .setRpcTimeoutMultiplier(1.5)
+ *             .setTotalTimeoutDuration(Duration.ofSeconds(300))
+ *             .build());
+ * MemorystoreStubSettings memorystoreSettings = memorystoreSettingsBuilder.build();
+ * }
+ * + * Please refer to the [Client Side Retry + * Guide](https://github.com/googleapis/google-cloud-java/blob/main/docs/client_retries.md) for + * additional support in setting retries. + * + *

To configure the RetrySettings of a Long Running Operation method, create an + * OperationTimedPollAlgorithm object and update the RPC's polling algorithm. For example, to + * configure the RetrySettings for createInstance: + * + *

{@code
+ * // This snippet has been automatically generated and should be regarded as a code template only.
+ * // It will require modifications to work:
+ * // - It may require correct/in-range values for request initialization.
+ * // - It may require specifying regional endpoints when creating the service client as shown in
+ * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
+ * MemorystoreStubSettings.Builder memorystoreSettingsBuilder =
+ *     MemorystoreStubSettings.newBuilder();
+ * TimedRetryAlgorithm timedRetryAlgorithm =
+ *     OperationalTimedPollAlgorithm.create(
+ *         RetrySettings.newBuilder()
+ *             .setInitialRetryDelayDuration(Duration.ofMillis(500))
+ *             .setRetryDelayMultiplier(1.5)
+ *             .setMaxRetryDelayDuration(Duration.ofMillis(5000))
+ *             .setTotalTimeoutDuration(Duration.ofHours(24))
+ *             .build());
+ * memorystoreSettingsBuilder
+ *     .createClusterOperationSettings()
+ *     .setPollingAlgorithm(timedRetryAlgorithm)
+ *     .build();
+ * }
+ */ +@BetaApi +@Generated("by gapic-generator-java") +public class MemorystoreStubSettings 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< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings getInstanceSettings; + private final UnaryCallSettings createInstanceSettings; + private final OperationCallSettings + createInstanceOperationSettings; + private final UnaryCallSettings updateInstanceSettings; + private final OperationCallSettings + updateInstanceOperationSettings; + private final UnaryCallSettings deleteInstanceSettings; + private final OperationCallSettings + deleteInstanceOperationSettings; + private final UnaryCallSettings + getCertificateAuthoritySettings; + private final PagedCallSettings< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings getLocationSettings; + + private static final PagedListDescriptor + LIST_INSTANCES_PAGE_STR_DESC = + new PagedListDescriptor() { + @Override + public String emptyToken() { + return ""; + } + + @Override + public ListInstancesRequest injectToken(ListInstancesRequest payload, String token) { + return ListInstancesRequest.newBuilder(payload).setPageToken(token).build(); + } + + @Override + public ListInstancesRequest injectPageSize(ListInstancesRequest payload, int pageSize) { + return ListInstancesRequest.newBuilder(payload).setPageSize(pageSize).build(); + } + + @Override + public Integer extractPageSize(ListInstancesRequest payload) { + return payload.getPageSize(); + } + + @Override + public String extractNextToken(ListInstancesResponse payload) { + return payload.getNextPageToken(); + } + + @Override + public Iterable extractResources(ListInstancesResponse payload) { + return payload.getInstancesList(); + } + }; + + 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(); + } + }; + + private static final PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + LIST_INSTANCES_PAGE_STR_FACT = + new PagedListResponseFactory< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse>() { + @Override + public ApiFuture getFuturePagedResponse( + UnaryCallable callable, + ListInstancesRequest request, + ApiCallContext context, + ApiFuture futureResponse) { + PageContext pageContext = + PageContext.create(callable, LIST_INSTANCES_PAGE_STR_DESC, request, context); + return ListInstancesPagedResponse.createAsync(pageContext, futureResponse); + } + }; + + private static final PagedListResponseFactory< + 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 listInstances. */ + public PagedCallSettings + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the object with the settings used for calls to getInstance. */ + public UnaryCallSettings getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public UnaryCallSettings createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the object with the settings used for calls to createInstance. */ + public OperationCallSettings + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public UnaryCallSettings updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the object with the settings used for calls to updateInstance. */ + public OperationCallSettings + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public UnaryCallSettings deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the object with the settings used for calls to deleteInstance. */ + public OperationCallSettings + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the object with the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings + getCertificateAuthoritySettings() { + return getCertificateAuthoritySettings; + } + + /** 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 MemorystoreStub createStub() throws IOException { + if (getTransportChannelProvider() + .getTransportName() + .equals(HttpJsonTransportChannel.getHttpJsonTransportName())) { + return HttpJsonMemorystoreStub.create(this); + } + throw new UnsupportedOperationException( + String.format( + "Transport not supported: %s", getTransportChannelProvider().getTransportName())); + } + + /** Returns the default service name. */ + @Override + public String getServiceName() { + return "memorystore"; + } + + /** Returns a builder for the default ExecutorProvider for this service. */ + public static InstantiatingExecutorProvider.Builder defaultExecutorProviderBuilder() { + return InstantiatingExecutorProvider.newBuilder(); + } + + /** Returns the default service endpoint. */ + @ObsoleteApi("Use getEndpoint() instead") + public static String getDefaultEndpoint() { + return "memorystore.googleapis.com:443"; + } + + /** Returns the default mTLS service endpoint. */ + public static String getDefaultMtlsEndpoint() { + return "memorystore.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 ChannelProvider for this service. */ + public static InstantiatingHttpJsonChannelProvider.Builder + defaultHttpJsonTransportProviderBuilder() { + return InstantiatingHttpJsonChannelProvider.newBuilder(); + } + + public static TransportChannelProvider defaultTransportChannelProvider() { + return defaultHttpJsonTransportProviderBuilder().build(); + } + + public static ApiClientHeaderProvider.Builder defaultApiClientHeaderProviderBuilder() { + return ApiClientHeaderProvider.newBuilder() + .setGeneratedLibToken( + "gapic", GaxProperties.getLibraryVersion(MemorystoreStubSettings.class)) + .setTransportToken( + GaxHttpJsonProperties.getHttpJsonTokenName(), + GaxHttpJsonProperties.getHttpJsonVersion()); + } + + /** Returns a new builder for this class. */ + public static Builder newBuilder() { + return Builder.createDefault(); + } + + /** 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 MemorystoreStubSettings(Builder settingsBuilder) throws IOException { + super(settingsBuilder); + + listInstancesSettings = settingsBuilder.listInstancesSettings().build(); + getInstanceSettings = settingsBuilder.getInstanceSettings().build(); + createInstanceSettings = settingsBuilder.createInstanceSettings().build(); + createInstanceOperationSettings = settingsBuilder.createInstanceOperationSettings().build(); + updateInstanceSettings = settingsBuilder.updateInstanceSettings().build(); + updateInstanceOperationSettings = settingsBuilder.updateInstanceOperationSettings().build(); + deleteInstanceSettings = settingsBuilder.deleteInstanceSettings().build(); + deleteInstanceOperationSettings = settingsBuilder.deleteInstanceOperationSettings().build(); + getCertificateAuthoritySettings = settingsBuilder.getCertificateAuthoritySettings().build(); + listLocationsSettings = settingsBuilder.listLocationsSettings().build(); + getLocationSettings = settingsBuilder.getLocationSettings().build(); + } + + /** Builder for MemorystoreStubSettings. */ + public static class Builder extends StubSettings.Builder { + private final ImmutableList> unaryMethodSettingsBuilders; + private final PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings; + private final UnaryCallSettings.Builder getInstanceSettings; + private final UnaryCallSettings.Builder + createInstanceSettings; + private final OperationCallSettings.Builder + createInstanceOperationSettings; + private final UnaryCallSettings.Builder + updateInstanceSettings; + private final OperationCallSettings.Builder + updateInstanceOperationSettings; + private final UnaryCallSettings.Builder + deleteInstanceSettings; + private final OperationCallSettings.Builder + deleteInstanceOperationSettings; + private final UnaryCallSettings.Builder + getCertificateAuthoritySettings; + private final PagedCallSettings.Builder< + ListLocationsRequest, ListLocationsResponse, ListLocationsPagedResponse> + listLocationsSettings; + private final UnaryCallSettings.Builder getLocationSettings; + private static final ImmutableMap> + RETRYABLE_CODE_DEFINITIONS; + + static { + ImmutableMap.Builder> definitions = + ImmutableMap.builder(); + definitions.put( + "retry_policy_0_codes", + ImmutableSet.copyOf(Lists.newArrayList(StatusCode.Code.UNAVAILABLE))); + definitions.put( + "no_retry_1_codes", ImmutableSet.copyOf(Lists.newArrayList())); + 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() + .setInitialRetryDelayDuration(Duration.ofMillis(1000L)) + .setRetryDelayMultiplier(1.3) + .setMaxRetryDelayDuration(Duration.ofMillis(10000L)) + .setInitialRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(60000L)) + .setTotalTimeoutDuration(Duration.ofMillis(60000L)) + .build(); + definitions.put("retry_policy_0_params", settings); + settings = + RetrySettings.newBuilder() + .setInitialRpcTimeoutDuration(Duration.ofMillis(600000L)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ofMillis(600000L)) + .setTotalTimeoutDuration(Duration.ofMillis(600000L)) + .build(); + definitions.put("no_retry_1_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); + + listInstancesSettings = PagedCallSettings.newBuilder(LIST_INSTANCES_PAGE_STR_FACT); + getInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + createInstanceOperationSettings = OperationCallSettings.newBuilder(); + updateInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + updateInstanceOperationSettings = OperationCallSettings.newBuilder(); + deleteInstanceSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + deleteInstanceOperationSettings = OperationCallSettings.newBuilder(); + getCertificateAuthoritySettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + listLocationsSettings = PagedCallSettings.newBuilder(LIST_LOCATIONS_PAGE_STR_FACT); + getLocationSettings = UnaryCallSettings.newUnaryCallSettingsBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + deleteInstanceSettings, + getCertificateAuthoritySettings, + listLocationsSettings, + getLocationSettings); + initDefaults(this); + } + + protected Builder(MemorystoreStubSettings settings) { + super(settings); + + listInstancesSettings = settings.listInstancesSettings.toBuilder(); + getInstanceSettings = settings.getInstanceSettings.toBuilder(); + createInstanceSettings = settings.createInstanceSettings.toBuilder(); + createInstanceOperationSettings = settings.createInstanceOperationSettings.toBuilder(); + updateInstanceSettings = settings.updateInstanceSettings.toBuilder(); + updateInstanceOperationSettings = settings.updateInstanceOperationSettings.toBuilder(); + deleteInstanceSettings = settings.deleteInstanceSettings.toBuilder(); + deleteInstanceOperationSettings = settings.deleteInstanceOperationSettings.toBuilder(); + getCertificateAuthoritySettings = settings.getCertificateAuthoritySettings.toBuilder(); + listLocationsSettings = settings.listLocationsSettings.toBuilder(); + getLocationSettings = settings.getLocationSettings.toBuilder(); + + unaryMethodSettingsBuilders = + ImmutableList.>of( + listInstancesSettings, + getInstanceSettings, + createInstanceSettings, + updateInstanceSettings, + deleteInstanceSettings, + getCertificateAuthoritySettings, + listLocationsSettings, + getLocationSettings); + } + + private static Builder createDefault() { + Builder builder = new Builder(((ClientContext) null)); + + builder.setTransportChannelProvider(defaultTransportChannelProvider()); + builder.setCredentialsProvider(defaultCredentialsProviderBuilder().build()); + builder.setInternalHeaderProvider(defaultApiClientHeaderProviderBuilder().build()); + builder.setMtlsEndpoint(getDefaultMtlsEndpoint()); + builder.setSwitchToMtlsEndpointAllowed(true); + + return initDefaults(builder); + } + + private static Builder initDefaults(Builder builder) { + builder + .listInstancesSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .getInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .createInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .updateInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .deleteInstanceSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")); + + builder + .getCertificateAuthoritySettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("retry_policy_0_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("retry_policy_0_params")); + + builder + .listLocationsSettings() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_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 + .createInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .updateInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Instance.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + builder + .deleteInstanceOperationSettings() + .setInitialCallSettings( + UnaryCallSettings + .newUnaryCallSettingsBuilder() + .setRetryableCodes(RETRYABLE_CODE_DEFINITIONS.get("no_retry_1_codes")) + .setRetrySettings(RETRY_PARAM_DEFINITIONS.get("no_retry_1_params")) + .build()) + .setResponseTransformer( + ProtoOperationTransformers.ResponseTransformer.create(Empty.class)) + .setMetadataTransformer( + ProtoOperationTransformers.MetadataTransformer.create(OperationMetadata.class)) + .setPollingAlgorithm( + OperationTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(5000L)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(45000L)) + .setInitialRpcTimeoutDuration(Duration.ZERO) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeoutDuration(Duration.ZERO) + .setTotalTimeoutDuration(Duration.ofMillis(300000L)) + .build())); + + return builder; + } + + /** + * Applies the given settings updater function to all of the unary API methods in this service. + * + *

Note: This method does not support applying settings to streaming methods. + */ + public Builder applyToAllUnaryMethods( + ApiFunction, Void> settingsUpdater) { + super.applyToAllUnaryMethods(unaryMethodSettingsBuilders, settingsUpdater); + return this; + } + + public ImmutableList> unaryMethodSettingsBuilders() { + return unaryMethodSettingsBuilders; + } + + /** Returns the builder for the settings used for calls to listInstances. */ + public PagedCallSettings.Builder< + ListInstancesRequest, ListInstancesResponse, ListInstancesPagedResponse> + listInstancesSettings() { + return listInstancesSettings; + } + + /** Returns the builder for the settings used for calls to getInstance. */ + public UnaryCallSettings.Builder getInstanceSettings() { + return getInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public UnaryCallSettings.Builder createInstanceSettings() { + return createInstanceSettings; + } + + /** Returns the builder for the settings used for calls to createInstance. */ + public OperationCallSettings.Builder + createInstanceOperationSettings() { + return createInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public UnaryCallSettings.Builder updateInstanceSettings() { + return updateInstanceSettings; + } + + /** Returns the builder for the settings used for calls to updateInstance. */ + public OperationCallSettings.Builder + updateInstanceOperationSettings() { + return updateInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public UnaryCallSettings.Builder deleteInstanceSettings() { + return deleteInstanceSettings; + } + + /** Returns the builder for the settings used for calls to deleteInstance. */ + public OperationCallSettings.Builder + deleteInstanceOperationSettings() { + return deleteInstanceOperationSettings; + } + + /** Returns the builder for the settings used for calls to getCertificateAuthority. */ + public UnaryCallSettings.Builder + getCertificateAuthoritySettings() { + return getCertificateAuthoritySettings; + } + + /** 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 MemorystoreStubSettings build() throws IOException { + return new MemorystoreStubSettings(this); + } + } +} diff --git a/java-valkey/google-cloud-valkey/src/main/resources/META-INF/native-image/com.google.cloud.memorystore.v1/reflect-config.json b/java-valkey/google-cloud-valkey/src/main/resources/META-INF/native-image/com.google.cloud.memorystore.v1/reflect-config.json new file mode 100644 index 000000000000..3d661ccf3e15 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/resources/META-INF/native-image/com.google.cloud.memorystore.v1/reflect-config.json @@ -0,0 +1,2045 @@ +[ + { + "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.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "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.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$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.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference$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.memorystore.v1.CertificateAuthority", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.CertificateAuthority$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.CertificateAuthority$ManagedCertificateAuthority", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.CertificateAuthority$ManagedCertificateAuthority$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.CertificateAuthority$ManagedCertificateAuthority$CertChain", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.CertificateAuthority$ManagedCertificateAuthority$CertChain$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ConnectionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.CreateInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.CreateInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.DeleteInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.DeleteInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.DiscoveryEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.DiscoveryEndpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.GetInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.GetInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$AuthorizationMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$ConnectionDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$ConnectionDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$InstanceEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$InstanceEndpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$Mode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$NodeType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$StateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$StateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$StateInfo$UpdateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$StateInfo$UpdateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.Instance$TransitEncryptionMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ListInstancesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ListInstancesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ListInstancesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ListInstancesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.NodeConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.NodeConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$AOFConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$AOFConfig$AppendFsync", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$AOFConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$PersistenceMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$RDBConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$RDBConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PersistenceConfig$RDBConfig$SnapshotPeriod", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PscAutoConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PscAutoConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PscConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PscConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.PscConnectionStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.UpdateInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.UpdateInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ZoneDistributionConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ZoneDistributionConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1.ZoneDistributionConfig$ZoneDistributionMode", + "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$Edition", + "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$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "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$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "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-valkey/google-cloud-valkey/src/main/resources/META-INF/native-image/com.google.cloud.memorystore.v1beta/reflect-config.json b/java-valkey/google-cloud-valkey/src/main/resources/META-INF/native-image/com.google.cloud.memorystore.v1beta/reflect-config.json new file mode 100644 index 000000000000..817e9849cd87 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/main/resources/META-INF/native-image/com.google.cloud.memorystore.v1beta/reflect-config.json @@ -0,0 +1,2045 @@ +[ + { + "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.FieldInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.FieldInfo$Format", + "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.PythonSettings$ExperimentalFeatures", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.PythonSettings$ExperimentalFeatures$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.api.SelectiveGapicGeneration", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.SelectiveGapicGeneration$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.api.TypeReference$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.memorystore.v1beta.CertificateAuthority", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.CertificateAuthority$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.CertificateAuthority$ManagedCertificateAuthority", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.CertificateAuthority$ManagedCertificateAuthority$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.CertificateAuthority$ManagedCertificateAuthority$CertChain", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.CertificateAuthority$ManagedCertificateAuthority$CertChain$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ConnectionType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.CreateInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.CreateInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.DeleteInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.DeleteInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.DiscoveryEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.DiscoveryEndpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.GetInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.GetInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$AuthorizationMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$ConnectionDetail", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$ConnectionDetail$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$InstanceEndpoint", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$InstanceEndpoint$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$Mode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$NodeType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$State", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$StateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$StateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$StateInfo$UpdateInfo", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$StateInfo$UpdateInfo$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.Instance$TransitEncryptionMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ListInstancesRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ListInstancesRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ListInstancesResponse", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ListInstancesResponse$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.NodeConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.NodeConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.OperationMetadata", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.OperationMetadata$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$AOFConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$AOFConfig$AppendFsync", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$AOFConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$PersistenceMode", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$RDBConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$RDBConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PersistenceConfig$RDBConfig$SnapshotPeriod", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PscAutoConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PscAutoConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PscConnection", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PscConnection$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.PscConnectionStatus", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.UpdateInstanceRequest", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.UpdateInstanceRequest$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ZoneDistributionConfig", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ZoneDistributionConfig$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.cloud.memorystore.v1beta.ZoneDistributionConfig$ZoneDistributionMode", + "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$Edition", + "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$FeatureSet", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$EnumType", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$FieldPresence", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$JsonFormat", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$MessageEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$RepeatedFieldEncoding", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSet$Utf8Validation", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$Builder", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FeatureSetDefaults$FeatureSetEditionDefault$Builder", + "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$EditionDefault", + "queryAllDeclaredConstructors": true, + "queryAllPublicConstructors": true, + "queryAllDeclaredMethods": true, + "allPublicMethods": true, + "allDeclaredClasses": true, + "allPublicClasses": true + }, + { + "name": "com.google.protobuf.DescriptorProtos$FieldOptions$EditionDefault$Builder", + "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-valkey/google-cloud-valkey/src/test/java/com/google/cloud/memorystore/v1/MemorystoreClientTest.java b/java-valkey/google-cloud-valkey/src/test/java/com/google/cloud/memorystore/v1/MemorystoreClientTest.java new file mode 100644 index 000000000000..7d15a628d8a3 --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/test/java/com/google/cloud/memorystore/v1/MemorystoreClientTest.java @@ -0,0 +1,843 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1; + +import static com.google.cloud.memorystore.v1.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1.MemorystoreClient.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.memorystore.v1.stub.HttpJsonMemorystoreStub; +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 MemorystoreClientTest { + private static MockHttpService mockService; + private static MemorystoreClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMemorystoreStub.getMethodDescriptors(), + MemorystoreSettings.getDefaultEndpoint()); + MemorystoreSettings settings = + MemorystoreSettings.newBuilder() + .setTransportChannelProvider( + MemorystoreSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MemorystoreClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Instance instance = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Instance instance = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getCertificateAuthorityTest() throws Exception { + CertificateAuthority expectedResponse = + CertificateAuthority.newBuilder().setName("name3373707").build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + CertificateAuthority actualResponse = client.getCertificateAuthority(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 getCertificateAuthorityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getCertificateAuthority(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCertificateAuthorityTest2() throws Exception { + CertificateAuthority expectedResponse = + CertificateAuthority.newBuilder().setName("name3373707").build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + CertificateAuthority actualResponse = client.getCertificateAuthority(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 getCertificateAuthorityExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.getCertificateAuthority(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-valkey/google-cloud-valkey/src/test/java/com/google/cloud/memorystore/v1beta/MemorystoreClientTest.java b/java-valkey/google-cloud-valkey/src/test/java/com/google/cloud/memorystore/v1beta/MemorystoreClientTest.java new file mode 100644 index 000000000000..42ff7af218cd --- /dev/null +++ b/java-valkey/google-cloud-valkey/src/test/java/com/google/cloud/memorystore/v1beta/MemorystoreClientTest.java @@ -0,0 +1,843 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta; + +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.ListInstancesPagedResponse; +import static com.google.cloud.memorystore.v1beta.MemorystoreClient.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.memorystore.v1beta.stub.HttpJsonMemorystoreStub; +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 MemorystoreClientTest { + private static MockHttpService mockService; + private static MemorystoreClient client; + + @BeforeClass + public static void startStaticServer() throws IOException { + mockService = + new MockHttpService( + HttpJsonMemorystoreStub.getMethodDescriptors(), + MemorystoreSettings.getDefaultEndpoint()); + MemorystoreSettings settings = + MemorystoreSettings.newBuilder() + .setTransportChannelProvider( + MemorystoreSettings.defaultHttpJsonTransportProviderBuilder() + .setHttpTransport(mockService) + .build()) + .setCredentialsProvider(NoCredentialsProvider.create()) + .build(); + client = MemorystoreClient.create(settings); + } + + @AfterClass + public static void stopServer() { + client.close(); + } + + @Before + public void setUp() {} + + @After + public void tearDown() throws Exception { + mockService.reset(); + } + + @Test + public void listInstancesTest() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listInstancesExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listInstancesTest2() throws Exception { + Instance responsesElement = Instance.newBuilder().build(); + ListInstancesResponse expectedResponse = + ListInstancesResponse.newBuilder() + .setNextPageToken("") + .addAllInstances(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + String parent = "projects/project-5833/locations/location-5833"; + + ListInstancesPagedResponse pagedListResponse = client.listInstances(parent); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getInstancesList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listInstancesExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + client.listInstances(parent); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + Instance actualResponse = client.getInstance(name); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.getInstance(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void createInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void createInstanceTest2() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("createInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String parent = "projects/project-5833/locations/location-5833"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + + Instance actualResponse = client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void createInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String parent = "projects/project-5833/locations/location-5833"; + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + client.createInstanceAsync(parent, instance, instanceId).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void updateInstanceTest() throws Exception { + Instance expectedResponse = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + Operation resultOperation = + Operation.newBuilder() + .setName("updateInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + Instance instance = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + + Instance actualResponse = client.updateInstanceAsync(instance, updateMask).get(); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void updateInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + Instance instance = + Instance.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setCreateTime(Timestamp.newBuilder().build()) + .setUpdateTime(Timestamp.newBuilder().build()) + .putAllLabels(new HashMap()) + .setStateInfo(Instance.StateInfo.newBuilder().build()) + .setUid("uid115792") + .setReplicaCount(564075208) + .setShardCount(-495377042) + .addAllDiscoveryEndpoints(new ArrayList()) + .setPersistenceConfig(PersistenceConfig.newBuilder().build()) + .setEngineVersion("engineVersion-1416229834") + .putAllEngineConfigs(new HashMap()) + .setNodeConfig(NodeConfig.newBuilder().build()) + .setZoneDistributionConfig(ZoneDistributionConfig.newBuilder().build()) + .setDeletionProtectionEnabled(true) + .addAllPscAutoConnections(new ArrayList()) + .addAllEndpoints(new ArrayList()) + .build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + client.updateInstanceAsync(instance, updateMask).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteInstanceExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void deleteInstanceTest2() throws Exception { + Empty expectedResponse = Empty.newBuilder().build(); + Operation resultOperation = + Operation.newBuilder() + .setName("deleteInstanceTest") + .setDone(true) + .setResponse(Any.pack(expectedResponse)) + .build(); + mockService.addResponse(resultOperation); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + client.deleteInstanceAsync(name).get(); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void deleteInstanceExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.deleteInstanceAsync(name).get(); + Assert.fail("No exception raised"); + } catch (ExecutionException e) { + } + } + + @Test + public void getCertificateAuthorityTest() throws Exception { + CertificateAuthority expectedResponse = + CertificateAuthority.newBuilder().setName("name3373707").build(); + mockService.addResponse(expectedResponse); + + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + + CertificateAuthority actualResponse = client.getCertificateAuthority(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 getCertificateAuthorityExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + client.getCertificateAuthority(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getCertificateAuthorityTest2() throws Exception { + CertificateAuthority expectedResponse = + CertificateAuthority.newBuilder().setName("name3373707").build(); + mockService.addResponse(expectedResponse); + + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + + CertificateAuthority actualResponse = client.getCertificateAuthority(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 getCertificateAuthorityExceptionTest2() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + String name = "projects/project-9412/locations/location-9412/instances/instance-9412"; + client.getCertificateAuthority(name); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void listLocationsTest() throws Exception { + Location responsesElement = Location.newBuilder().build(); + ListLocationsResponse expectedResponse = + ListLocationsResponse.newBuilder() + .setNextPageToken("") + .addAllLocations(Arrays.asList(responsesElement)) + .build(); + mockService.addResponse(expectedResponse); + + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + + ListLocationsPagedResponse pagedListResponse = client.listLocations(request); + + List resources = Lists.newArrayList(pagedListResponse.iterateAll()); + + Assert.assertEquals(1, resources.size()); + Assert.assertEquals(expectedResponse.getLocationsList().get(0), resources.get(0)); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void listLocationsExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("projects/project-3664") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + client.listLocations(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } + + @Test + public void getLocationTest() throws Exception { + Location expectedResponse = + Location.newBuilder() + .setName("name3373707") + .setLocationId("locationId1541836720") + .setDisplayName("displayName1714148973") + .putAllLabels(new HashMap()) + .setMetadata(Any.newBuilder().build()) + .build(); + mockService.addResponse(expectedResponse); + + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + + Location actualResponse = client.getLocation(request); + Assert.assertEquals(expectedResponse, actualResponse); + + List actualRequests = mockService.getRequestPaths(); + Assert.assertEquals(1, actualRequests.size()); + + String apiClientHeaderKey = + mockService + .getRequestHeaders() + .get(ApiClientHeaderProvider.getDefaultApiClientHeaderKey()) + .iterator() + .next(); + Assert.assertTrue( + GaxHttpJsonProperties.getDefaultApiClientHeaderPattern() + .matcher(apiClientHeaderKey) + .matches()); + } + + @Test + public void getLocationExceptionTest() throws Exception { + ApiException exception = + ApiExceptionFactory.createException( + new Exception(), FakeStatusCode.of(StatusCode.Code.INVALID_ARGUMENT), false); + mockService.addException(exception); + + try { + GetLocationRequest request = + GetLocationRequest.newBuilder() + .setName("projects/project-9062/locations/location-9062") + .build(); + client.getLocation(request); + Assert.fail("No exception raised"); + } catch (InvalidArgumentException e) { + // Expected exception. + } + } +} diff --git a/java-valkey/owlbot.py b/java-valkey/owlbot.py new file mode 100644 index 000000000000..2ba11e6bba67 --- /dev/null +++ b/java-valkey/owlbot.py @@ -0,0 +1,36 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT 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-valkey/pom.xml b/java-valkey/pom.xml new file mode 100644 index 000000000000..cf65cbac51c6 --- /dev/null +++ b/java-valkey/pom.xml @@ -0,0 +1,55 @@ + + + 4.0.0 + com.google.cloud + google-cloud-valkey-parent + pom + 0.0.1-SNAPSHOT + Google Memorystore API Parent + + Java idiomatic client for Google Cloud Platform services. + + + + com.google.cloud + google-cloud-jar-parent + 1.49.0-SNAPSHOT + ../google-cloud-jar-parent/pom.xml + + + + UTF-8 + UTF-8 + github + google-cloud-valkey-parent + + + + + + com.google.cloud + google-cloud-valkey + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-valkey-v1 + 0.0.1-SNAPSHOT + + + com.google.api.grpc + proto-google-cloud-valkey-v1beta + 0.0.1-SNAPSHOT + + + + + + + google-cloud-valkey + proto-google-cloud-valkey-v1 + proto-google-cloud-valkey-v1beta + google-cloud-valkey-bom + + + diff --git a/java-valkey/proto-google-cloud-valkey-v1/clirr-ignored-differences.xml b/java-valkey/proto-google-cloud-valkey-v1/clirr-ignored-differences.xml new file mode 100644 index 000000000000..70e35c15384c --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/clirr-ignored-differences.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/java-valkey/proto-google-cloud-valkey-v1/pom.xml b/java-valkey/proto-google-cloud-valkey-v1/pom.xml new file mode 100644 index 000000000000..57a14d52a390 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-valkey-v1 + 0.0.1-SNAPSHOT + proto-google-cloud-valkey-v1 + Proto library for google-cloud-valkey + + com.google.cloud + google-cloud-valkey-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-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CertificateAuthority.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CertificateAuthority.java new file mode 100644 index 000000000000..7eb1a930742f --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CertificateAuthority.java @@ -0,0 +1,3058 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *

+ * A certificate authority for an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.CertificateAuthority} + */ +public final class CertificateAuthority extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.CertificateAuthority) + CertificateAuthorityOrBuilder { + private static final long serialVersionUID = 0L; + // Use CertificateAuthority.newBuilder() to construct. + private CertificateAuthority(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CertificateAuthority() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CertificateAuthority(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CertificateAuthority.class, + com.google.cloud.memorystore.v1.CertificateAuthority.Builder.class); + } + + public interface ManagedCertificateAuthorityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + java.util.List< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + getCaCertsList(); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + getCaCerts(int index); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + int getCaCertsCount(); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + getCaCertsOrBuilderList(); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder + getCaCertsOrBuilder(int index); + } + /** + * + * + *
+   * A managed certificate authority.
+   * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority} + */ + public static final class ManagedCertificateAuthority + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + ManagedCertificateAuthorityOrBuilder { + private static final long serialVersionUID = 0L; + // Use ManagedCertificateAuthority.newBuilder() to construct. + private ManagedCertificateAuthority(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ManagedCertificateAuthority() { + caCerts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ManagedCertificateAuthority(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .class, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .Builder.class); + } + + public interface CertChainOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return A list containing the certificates. + */ + java.util.List getCertificatesList(); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return The count of certificates. + */ + int getCertificatesCount(); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the element to return. + * @return The certificates at the given index. + */ + java.lang.String getCertificates(int index); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the value to return. + * @return The bytes of the certificates at the given index. + */ + com.google.protobuf.ByteString getCertificatesBytes(int index); + } + /** + * + * + *
+     * A certificate chain.
+     * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain} + */ + public static final class CertChain extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain) + CertChainOrBuilder { + private static final long serialVersionUID = 0L; + // Use CertChain.newBuilder() to construct. + private CertChain(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CertChain() { + certificates_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CertChain(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.class, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder.class); + } + + public static final int CERTIFICATES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList certificates_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return A list containing the certificates. + */ + public com.google.protobuf.ProtocolStringList getCertificatesList() { + return certificates_; + } + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return The count of certificates. + */ + public int getCertificatesCount() { + return certificates_.size(); + } + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the element to return. + * @return The certificates at the given index. + */ + public java.lang.String getCertificates(int index) { + return certificates_.get(index); + } + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the value to return. + * @return The bytes of the certificates at the given index. + */ + public com.google.protobuf.ByteString getCertificatesBytes(int index) { + return certificates_.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 < certificates_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, certificates_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < certificates_.size(); i++) { + dataSize += computeStringSizeNoTag(certificates_.getRaw(i)); + } + size += dataSize; + size += 1 * getCertificatesList().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.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + other = + (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain) + obj; + + if (!getCertificatesList().equals(other.getCertificatesList())) return false; + if (!getUnknownFields().equals(other.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 (getCertificatesCount() > 0) { + hash = (37 * hash) + CERTIFICATES_FIELD_NUMBER; + hash = (53 * hash) + getCertificatesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 certificate chain.
+       * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain) + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.class, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certificates_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + build() { + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + buildPartial() { + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + result = + new com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthority.CertChain(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + certificates_.makeImmutable(); + result.certificates_ = certificates_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain) { + return mergeFrom( + (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + other) { + if (other + == com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.getDefaultInstance()) return this; + if (!other.certificates_.isEmpty()) { + if (certificates_.isEmpty()) { + certificates_ = other.certificates_; + bitField0_ |= 0x00000001; + } else { + ensureCertificatesIsMutable(); + certificates_.addAll(other.certificates_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCertificatesIsMutable(); + certificates_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList certificates_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCertificatesIsMutable() { + if (!certificates_.isModifiable()) { + certificates_ = new com.google.protobuf.LazyStringArrayList(certificates_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @return A list containing the certificates. + */ + public com.google.protobuf.ProtocolStringList getCertificatesList() { + certificates_.makeImmutable(); + return certificates_; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @return The count of certificates. + */ + public int getCertificatesCount() { + return certificates_.size(); + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the element to return. + * @return The certificates at the given index. + */ + public java.lang.String getCertificates(int index) { + return certificates_.get(index); + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the value to return. + * @return The bytes of the certificates at the given index. + */ + public com.google.protobuf.ByteString getCertificatesBytes(int index) { + return certificates_.getByteString(index); + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param index The index to set the value at. + * @param value The certificates to set. + * @return This builder for chaining. + */ + public Builder setCertificates(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificatesIsMutable(); + certificates_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param value The certificates to add. + * @return This builder for chaining. + */ + public Builder addCertificates(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificatesIsMutable(); + certificates_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param values The certificates to add. + * @return This builder for chaining. + */ + public Builder addAllCertificates(java.lang.Iterable values) { + ensureCertificatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certificates_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @return This builder for chaining. + */ + public Builder clearCertificates() { + certificates_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param value The bytes of the certificates to add. + * @return This builder for chaining. + */ + public Builder addCertificatesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCertificatesIsMutable(); + certificates_.add(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.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain) + private static final com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthority.CertChain + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain(); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CertChain parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CA_CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + caCerts_; + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + getCaCertsList() { + return caCerts_; + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + getCaCertsOrBuilderList() { + return caCerts_; + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public int getCaCertsCount() { + return caCerts_.size(); + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getCaCerts(int index) { + return caCerts_.get(index); + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder + getCaCertsOrBuilder(int index) { + return caCerts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < caCerts_.size(); i++) { + output.writeMessage(1, caCerts_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < caCerts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, caCerts_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority other = + (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) obj; + + if (!getCaCertsList().equals(other.getCaCertsList())) return false; + if (!getUnknownFields().equals(other.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 (getCaCertsCount() > 0) { + hash = (37 * hash) + CA_CERTS_FIELD_NUMBER; + hash = (53 * hash) + getCaCertsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 managed certificate authority.
+     * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthorityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .class, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (caCertsBuilder_ == null) { + caCerts_ = java.util.Collections.emptyList(); + } else { + caCerts_ = null; + caCertsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + build() { + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + buildPartial() { + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority result = + new com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority( + this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority result) { + if (caCertsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + caCerts_ = java.util.Collections.unmodifiableList(caCerts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.caCerts_ = caCerts_; + } else { + result.caCerts_ = caCertsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) { + return mergeFrom( + (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority other) { + if (other + == com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance()) return this; + if (caCertsBuilder_ == null) { + if (!other.caCerts_.isEmpty()) { + if (caCerts_.isEmpty()) { + caCerts_ = other.caCerts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCaCertsIsMutable(); + caCerts_.addAll(other.caCerts_); + } + onChanged(); + } + } else { + if (!other.caCerts_.isEmpty()) { + if (caCertsBuilder_.isEmpty()) { + caCertsBuilder_.dispose(); + caCertsBuilder_ = null; + caCerts_ = other.caCerts_; + bitField0_ = (bitField0_ & ~0x00000001); + caCertsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCaCertsFieldBuilder() + : null; + } else { + caCertsBuilder_.addAllMessages(other.caCerts_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + m = + input.readMessage( + com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthority.CertChain.parser(), + extensionRegistry); + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(m); + } else { + caCertsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + caCerts_ = java.util.Collections.emptyList(); + + private void ensureCaCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + caCerts_ = + new java.util.ArrayList< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain>(caCerts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + caCertsBuilder_; + + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public java.util.List< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + getCaCertsList() { + if (caCertsBuilder_ == null) { + return java.util.Collections.unmodifiableList(caCerts_); + } else { + return caCertsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public int getCaCertsCount() { + if (caCertsBuilder_ == null) { + return caCerts_.size(); + } else { + return caCertsBuilder_.getCount(); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getCaCerts(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder setCaCerts( + int index, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.set(index, value); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder setCaCerts( + int index, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + .Builder + builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.set(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(value); + onChanged(); + } else { + caCertsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + int index, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(index, value); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + .Builder + builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + int index, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain + .Builder + builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addAllCaCerts( + java.lang.Iterable< + ? extends + com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthority.CertChain> + values) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, caCerts_); + onChanged(); + } else { + caCertsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder clearCaCerts() { + if (caCertsBuilder_ == null) { + caCerts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + caCertsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder removeCaCerts(int index) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.remove(index); + onChanged(); + } else { + caCertsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + getCaCertsBuilder(int index) { + return getCaCertsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder + getCaCertsOrBuilder(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + getCaCertsOrBuilderList() { + if (caCertsBuilder_ != null) { + return caCertsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(caCerts_); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + addCaCertsBuilder() { + return getCaCertsFieldBuilder() + .addBuilder( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.getDefaultInstance()); + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + addCaCertsBuilder(int index) { + return getCaCertsFieldBuilder() + .addBuilder( + index, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.getDefaultInstance()); + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public java.util.List< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder> + getCaCertsBuilderList() { + return getCaCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + getCaCertsFieldBuilder() { + if (caCertsBuilder_ == null) { + caCertsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder>( + caCerts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + caCerts_ = null; + } + return caCertsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + private static final com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthority + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority(); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ManagedCertificateAuthority parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int serverCaCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object serverCa_; + + public enum ServerCaCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MANAGED_SERVER_CA(2), + SERVERCA_NOT_SET(0); + private final int value; + + private ServerCaCase(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 ServerCaCase valueOf(int value) { + return forNumber(value); + } + + public static ServerCaCase forNumber(int value) { + switch (value) { + case 2: + return MANAGED_SERVER_CA; + case 0: + return SERVERCA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ServerCaCase getServerCaCase() { + return ServerCaCase.forNumber(serverCaCase_); + } + + public static final int MANAGED_SERVER_CA_FIELD_NUMBER = 2; + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return Whether the managedServerCa field is set. + */ + @java.lang.Override + public boolean hasManagedServerCa() { + return serverCaCase_ == 2; + } + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return The managedServerCa. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + getManagedServerCa() { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthorityOrBuilder + getManagedServerCaOrBuilder() { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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_); + } + if (serverCaCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + serverCa_); + } + 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 (serverCaCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + serverCa_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.CertificateAuthority)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.CertificateAuthority other = + (com.google.cloud.memorystore.v1.CertificateAuthority) obj; + + if (!getName().equals(other.getName())) return false; + if (!getServerCaCase().equals(other.getServerCaCase())) return false; + switch (serverCaCase_) { + case 2: + if (!getManagedServerCa().equals(other.getManagedServerCa())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + switch (serverCaCase_) { + case 2: + hash = (37 * hash) + MANAGED_SERVER_CA_FIELD_NUMBER; + hash = (53 * hash) + getManagedServerCa().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1.CertificateAuthority prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 certificate authority for an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.CertificateAuthority} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.CertificateAuthority) + com.google.cloud.memorystore.v1.CertificateAuthorityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CertificateAuthority.class, + com.google.cloud.memorystore.v1.CertificateAuthority.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.CertificateAuthority.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (managedServerCaBuilder_ != null) { + managedServerCaBuilder_.clear(); + } + name_ = ""; + serverCaCase_ = 0; + serverCa_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CertificateAuthority_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.CertificateAuthority.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority build() { + com.google.cloud.memorystore.v1.CertificateAuthority result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority buildPartial() { + com.google.cloud.memorystore.v1.CertificateAuthority result = + new com.google.cloud.memorystore.v1.CertificateAuthority(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.CertificateAuthority result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + } + + private void buildPartialOneofs(com.google.cloud.memorystore.v1.CertificateAuthority result) { + result.serverCaCase_ = serverCaCase_; + result.serverCa_ = this.serverCa_; + if (serverCaCase_ == 2 && managedServerCaBuilder_ != null) { + result.serverCa_ = managedServerCaBuilder_.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.memorystore.v1.CertificateAuthority) { + return mergeFrom((com.google.cloud.memorystore.v1.CertificateAuthority) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.CertificateAuthority other) { + if (other == com.google.cloud.memorystore.v1.CertificateAuthority.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + switch (other.getServerCaCase()) { + case MANAGED_SERVER_CA: + { + mergeManagedServerCa(other.getManagedServerCa()); + break; + } + case SERVERCA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(getManagedServerCaFieldBuilder().getBuilder(), extensionRegistry); + serverCaCase_ = 2; + 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 serverCaCase_ = 0; + private java.lang.Object serverCa_; + + public ServerCaCase getServerCaCase() { + return ServerCaCase.forNumber(serverCaCase_); + } + + public Builder clearServerCa() { + serverCaCase_ = 0; + serverCa_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .Builder, + com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder> + managedServerCaBuilder_; + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return Whether the managedServerCa field is set. + */ + @java.lang.Override + public boolean hasManagedServerCa() { + return serverCaCase_ == 2; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return The managedServerCa. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + getManagedServerCa() { + if (managedServerCaBuilder_ == null) { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } else { + if (serverCaCase_ == 2) { + return managedServerCaBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder setManagedServerCa( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority value) { + if (managedServerCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCa_ = value; + onChanged(); + } else { + managedServerCaBuilder_.setMessage(value); + } + serverCaCase_ = 2; + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder setManagedServerCa( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.Builder + builderForValue) { + if (managedServerCaBuilder_ == null) { + serverCa_ = builderForValue.build(); + onChanged(); + } else { + managedServerCaBuilder_.setMessage(builderForValue.build()); + } + serverCaCase_ = 2; + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder mergeManagedServerCa( + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority value) { + if (managedServerCaBuilder_ == null) { + if (serverCaCase_ == 2 + && serverCa_ + != com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance()) { + serverCa_ = + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .newBuilder( + (com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthority) + serverCa_) + .mergeFrom(value) + .buildPartial(); + } else { + serverCa_ = value; + } + onChanged(); + } else { + if (serverCaCase_ == 2) { + managedServerCaBuilder_.mergeFrom(value); + } else { + managedServerCaBuilder_.setMessage(value); + } + } + serverCaCase_ = 2; + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder clearManagedServerCa() { + if (managedServerCaBuilder_ == null) { + if (serverCaCase_ == 2) { + serverCaCase_ = 0; + serverCa_ = null; + onChanged(); + } + } else { + if (serverCaCase_ == 2) { + serverCaCase_ = 0; + serverCa_ = null; + } + managedServerCaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority.Builder + getManagedServerCaBuilder() { + return getManagedServerCaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthorityOrBuilder + getManagedServerCaOrBuilder() { + if ((serverCaCase_ == 2) && (managedServerCaBuilder_ != null)) { + return managedServerCaBuilder_.getMessageOrBuilder(); + } else { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .Builder, + com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder> + getManagedServerCaFieldBuilder() { + if (managedServerCaBuilder_ == null) { + if (!(serverCaCase_ == 2)) { + serverCa_ = + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + managedServerCaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority, + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + .Builder, + com.google.cloud.memorystore.v1.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder>( + (com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority) + serverCa_, + getParentForChildren(), + isClean()); + serverCa_ = null; + } + serverCaCase_ = 2; + onChanged(); + return managedServerCaBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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_ |= 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.memorystore.v1.CertificateAuthority) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.CertificateAuthority) + private static final com.google.cloud.memorystore.v1.CertificateAuthority DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.CertificateAuthority(); + } + + public static com.google.cloud.memorystore.v1.CertificateAuthority getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CertificateAuthority parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CertificateAuthority getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CertificateAuthorityOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CertificateAuthorityOrBuilder.java new file mode 100644 index 000000000000..718a57475478 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CertificateAuthorityOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface CertificateAuthorityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.CertificateAuthority) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return Whether the managedServerCa field is set. + */ + boolean hasManagedServerCa(); + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return The managedServerCa. + */ + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority + getManagedServerCa(); + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + com.google.cloud.memorystore.v1.CertificateAuthority.ManagedCertificateAuthorityOrBuilder + getManagedServerCaOrBuilder(); + + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + com.google.cloud.memorystore.v1.CertificateAuthority.ServerCaCase getServerCaCase(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ConnectionType.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ConnectionType.java new file mode 100644 index 000000000000..0db6d55cf867 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ConnectionType.java @@ -0,0 +1,199 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Type of a PSC connection
+ * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.ConnectionType} + */ +public enum ConnectionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Connection Type is not set
+   * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + CONNECTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Connection that will be used for topology discovery.
+   * 
+ * + * CONNECTION_TYPE_DISCOVERY = 1; + */ + CONNECTION_TYPE_DISCOVERY(1), + /** + * + * + *
+   * Connection that will be used as primary endpoint to access primary.
+   * 
+ * + * CONNECTION_TYPE_PRIMARY = 2; + */ + CONNECTION_TYPE_PRIMARY(2), + /** + * + * + *
+   * Connection that will be used as reader endpoint to access replicas.
+   * 
+ * + * CONNECTION_TYPE_READER = 3; + */ + CONNECTION_TYPE_READER(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Connection Type is not set
+   * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + public static final int CONNECTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Connection that will be used for topology discovery.
+   * 
+ * + * CONNECTION_TYPE_DISCOVERY = 1; + */ + public static final int CONNECTION_TYPE_DISCOVERY_VALUE = 1; + /** + * + * + *
+   * Connection that will be used as primary endpoint to access primary.
+   * 
+ * + * CONNECTION_TYPE_PRIMARY = 2; + */ + public static final int CONNECTION_TYPE_PRIMARY_VALUE = 2; + /** + * + * + *
+   * Connection that will be used as reader endpoint to access replicas.
+   * 
+ * + * CONNECTION_TYPE_READER = 3; + */ + public static final int CONNECTION_TYPE_READER_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConnectionType 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 ConnectionType forNumber(int value) { + switch (value) { + case 0: + return CONNECTION_TYPE_UNSPECIFIED; + case 1: + return CONNECTION_TYPE_DISCOVERY; + case 2: + return CONNECTION_TYPE_PRIMARY; + case 3: + return CONNECTION_TYPE_READER; + 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 ConnectionType findValueByNumber(int number) { + return ConnectionType.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.memorystore.v1.V1mainProto.getDescriptor().getEnumTypes().get(1); + } + + private static final ConnectionType[] VALUES = values(); + + public static ConnectionType 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 ConnectionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.ConnectionType) +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CreateInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CreateInstanceRequest.java new file mode 100644 index 000000000000..bc4cef226377 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CreateInstanceRequest.java @@ -0,0 +1,1475 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Request message for [CreateInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CreateInstanceRequest.class, + com.google.cloud.memorystore.v1.CreateInstanceRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.memorystore.v1.Instance instance_; + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getInstance()); + } + 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(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + 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.memorystore.v1.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.CreateInstanceRequest other = + (com.google.cloud.memorystore.v1.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.CreateInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [CreateInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.CreateInstanceRequest) + com.google.cloud.memorystore.v1.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.CreateInstanceRequest.class, + com.google.cloud.memorystore.v1.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.CreateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstanceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CreateInstanceRequest build() { + com.google.cloud.memorystore.v1.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CreateInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1.CreateInstanceRequest result = + new com.google.cloud.memorystore.v1.CreateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.CreateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + 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.memorystore.v1.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.CreateInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.memorystore.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.memorystore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.memorystore.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.memorystore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.memorystore.v1.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + if (instance_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.CreateInstanceRequest) + private static final com.google.cloud.memorystore.v1.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.CreateInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CreateInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CreateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..43cd62e80991 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,194 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.memorystore.v1.Instance getInstance(); + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.memorystore.v1.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DeleteInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DeleteInstanceRequest.java new file mode 100644 index 000000000000..a5766dd8997e --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DeleteInstanceRequest.java @@ -0,0 +1,927 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Request message for [DeleteInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.DeleteInstanceRequest.class, + com.google.cloud.memorystore.v1.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.DeleteInstanceRequest other = + (com.google.cloud.memorystore.v1.DeleteInstanceRequest) 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.memorystore.v1.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.DeleteInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [DeleteInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.DeleteInstanceRequest) + com.google.cloud.memorystore.v1.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.DeleteInstanceRequest.class, + com.google.cloud.memorystore.v1.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.DeleteInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.DeleteInstanceRequest build() { + com.google.cloud.memorystore.v1.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.DeleteInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1.DeleteInstanceRequest result = + new com.google.cloud.memorystore.v1.DeleteInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.DeleteInstanceRequest 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.memorystore.v1.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.DeleteInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.DeleteInstanceRequest) + private static final com.google.cloud.memorystore.v1.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.DeleteInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DeleteInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..da3f9f19e256 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DeleteInstanceRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DiscoveryEndpoint.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DiscoveryEndpoint.java new file mode 100644 index 000000000000..d4bed84ec8ea --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DiscoveryEndpoint.java @@ -0,0 +1,928 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Represents an endpoint for clients to connect to the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.DiscoveryEndpoint} + */ +public final class DiscoveryEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.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_ = ""; + network_ = ""; + } + + @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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.DiscoveryEndpoint.class, + com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder.class); + } + + public static final int ADDRESS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object address_ = ""; + /** + * + * + *
+   * Output only. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * 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 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 NETWORK_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, 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(address_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, address_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, port_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.memorystore.v1.DiscoveryEndpoint)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.DiscoveryEndpoint other = + (com.google.cloud.memorystore.v1.DiscoveryEndpoint) obj; + + if (!getAddress().equals(other.getAddress())) return false; + if (getPort() != other.getPort()) 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) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + 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.memorystore.v1.DiscoveryEndpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.DiscoveryEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.DiscoveryEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.DiscoveryEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.DiscoveryEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.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.memorystore.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.memorystore.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.memorystore.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; + } + /** + * + * + *
+   * Represents an endpoint for clients to connect to the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.DiscoveryEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.DiscoveryEndpoint) + com.google.cloud.memorystore.v1.DiscoveryEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.DiscoveryEndpoint.class, + com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder.class); + } + + // Construct using com.google.cloud.memorystore.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; + network_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.DiscoveryEndpoint getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.DiscoveryEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.DiscoveryEndpoint build() { + com.google.cloud.memorystore.v1.DiscoveryEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.DiscoveryEndpoint buildPartial() { + com.google.cloud.memorystore.v1.DiscoveryEndpoint result = + new com.google.cloud.memorystore.v1.DiscoveryEndpoint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.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.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.memorystore.v1.DiscoveryEndpoint) { + return mergeFrom((com.google.cloud.memorystore.v1.DiscoveryEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.DiscoveryEndpoint other) { + if (other == com.google.cloud.memorystore.v1.DiscoveryEndpoint.getDefaultInstance()) + return this; + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + 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: + { + address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + port_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 34: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object address_ = ""; + /** + * + * + *
+     * Output only. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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 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 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 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 java.lang.Object network_ = ""; + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 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.memorystore.v1.DiscoveryEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.DiscoveryEndpoint) + private static final com.google.cloud.memorystore.v1.DiscoveryEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.DiscoveryEndpoint(); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.DiscoveryEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DiscoveryEndpointOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DiscoveryEndpointOrBuilder.java new file mode 100644 index 000000000000..0bd761d88c43 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/DiscoveryEndpointOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface DiscoveryEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.DiscoveryEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + java.lang.String getAddress(); + /** + * + * + *
+   * Output only. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * 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 endpoint.
+   * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + int getPort(); + + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetCertificateAuthorityRequest.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetCertificateAuthorityRequest.java new file mode 100644 index 000000000000..0517f010b9e0 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetCertificateAuthorityRequest.java @@ -0,0 +1,661 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Request message for [GetCertificateAuthority][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.GetCertificateAuthorityRequest} + */ +public final class GetCertificateAuthorityRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.GetCertificateAuthorityRequest) + GetCertificateAuthorityRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCertificateAuthorityRequest.newBuilder() to construct. + private GetCertificateAuthorityRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCertificateAuthorityRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCertificateAuthorityRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest.class, + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * 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.memorystore.v1.GetCertificateAuthorityRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest other = + (com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest) 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.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [GetCertificateAuthority][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.GetCertificateAuthorityRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.GetCertificateAuthorityRequest) + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest.class, + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest.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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest build() { + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest buildPartial() { + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest result = + new com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest 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.memorystore.v1.GetCertificateAuthorityRequest) { + return mergeFrom((com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest other) { + if (other + == com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * 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.memorystore.v1.GetCertificateAuthorityRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.GetCertificateAuthorityRequest) + private static final com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest(); + } + + public static com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCertificateAuthorityRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetCertificateAuthorityRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetCertificateAuthorityRequestOrBuilder.java new file mode 100644 index 000000000000..1013a14d2e3f --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetCertificateAuthorityRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface GetCertificateAuthorityRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.GetCertificateAuthorityRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * 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-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetInstanceRequest.java new file mode 100644 index 000000000000..56707348e28b --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetInstanceRequest.java @@ -0,0 +1,646 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Request message for [GetInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.GetInstanceRequest} + */ +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.GetInstanceRequest.class, + com.google.cloud.memorystore.v1.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * 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.memorystore.v1.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.GetInstanceRequest other = + (com.google.cloud.memorystore.v1.GetInstanceRequest) 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.memorystore.v1.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1.GetInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [GetInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.GetInstanceRequest) + com.google.cloud.memorystore.v1.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.GetInstanceRequest.class, + com.google.cloud.memorystore.v1.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.GetInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetInstanceRequest build() { + com.google.cloud.memorystore.v1.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1.GetInstanceRequest result = + new com.google.cloud.memorystore.v1.GetInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.GetInstanceRequest 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.memorystore.v1.GetInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.GetInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1.GetInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * 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.memorystore.v1.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.GetInstanceRequest) + private static final com.google.cloud.memorystore.v1.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.GetInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..f6f268441c88 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/GetInstanceRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * 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-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/Instance.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/Instance.java new file mode 100644 index 000000000000..8abd4ba9dfdc --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/Instance.java @@ -0,0 +1,11219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * A Memorystore instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance} + */ +public final class Instance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + state_ = 0; + uid_ = ""; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + discoveryEndpoints_ = java.util.Collections.emptyList(); + nodeType_ = 0; + engineVersion_ = ""; + pscAutoConnections_ = java.util.Collections.emptyList(); + endpoints_ = java.util.Collections.emptyList(); + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instance(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetLabels(); + case 16: + return internalGetEngineConfigs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.class, + com.google.cloud.memorystore.v1.Instance.Builder.class); + } + + /** + * + * + *
+   * Possible states of the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Instance has been created and is usable.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + /** + * + * + *
+     * Instance is being updated.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+     * Instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Instance has been created and is usable.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + /** + * + * + *
+     * Instance is being updated.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + * + * + *
+     * Instance 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.memorystore.v1.Instance.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.Instance.State) + } + + /** + * + * + *
+   * Possible authorization modes of the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.Instance.AuthorizationMode} + */ + public enum AuthorizationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * AUTHORIZATION_MODE_UNSPECIFIED = 0; + */ + AUTHORIZATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Authorization disabled.
+     * 
+ * + * AUTH_DISABLED = 1; + */ + AUTH_DISABLED(1), + /** + * + * + *
+     * IAM basic authorization.
+     * 
+ * + * IAM_AUTH = 2; + */ + IAM_AUTH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * AUTHORIZATION_MODE_UNSPECIFIED = 0; + */ + public static final int AUTHORIZATION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Authorization disabled.
+     * 
+ * + * AUTH_DISABLED = 1; + */ + public static final int AUTH_DISABLED_VALUE = 1; + /** + * + * + *
+     * IAM basic authorization.
+     * 
+ * + * IAM_AUTH = 2; + */ + public static final int IAM_AUTH_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 AUTHORIZATION_MODE_UNSPECIFIED; + case 1: + return AUTH_DISABLED; + case 2: + return IAM_AUTH; + 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.memorystore.v1.Instance.getDescriptor().getEnumTypes().get(1); + } + + 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.memorystore.v1.Instance.AuthorizationMode) + } + + /** + * + * + *
+   * Possible in-transit encryption modes of the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.Instance.TransitEncryptionMode} + */ + public enum TransitEncryptionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * In-transit encryption is disabled.
+     * 
+ * + * TRANSIT_ENCRYPTION_DISABLED = 1; + */ + TRANSIT_ENCRYPTION_DISABLED(1), + /** + * + * + *
+     * Server-managed encryption is used for in-transit encryption.
+     * 
+ * + * SERVER_AUTHENTICATION = 2; + */ + SERVER_AUTHENTICATION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + public static final int TRANSIT_ENCRYPTION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * In-transit encryption is disabled.
+     * 
+ * + * TRANSIT_ENCRYPTION_DISABLED = 1; + */ + public static final int TRANSIT_ENCRYPTION_DISABLED_VALUE = 1; + /** + * + * + *
+     * Server-managed encryption is used for in-transit encryption.
+     * 
+ * + * SERVER_AUTHENTICATION = 2; + */ + public static final int 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_DISABLED; + case 2: + return 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.memorystore.v1.Instance.getDescriptor().getEnumTypes().get(2); + } + + 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.memorystore.v1.Instance.TransitEncryptionMode) + } + + /** + * + * + *
+   * Possible node types of the instance. See
+   * https://cloud.google.com/memorystore/docs/valkey/instance-node-specification
+   * for more information.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.Instance.NodeType} + */ + public enum NodeType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * NODE_TYPE_UNSPECIFIED = 0; + */ + NODE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Shared core nano.
+     * 
+ * + * SHARED_CORE_NANO = 1; + */ + SHARED_CORE_NANO(1), + /** + * + * + *
+     * High memory medium.
+     * 
+ * + * HIGHMEM_MEDIUM = 2; + */ + HIGHMEM_MEDIUM(2), + /** + * + * + *
+     * High memory extra large.
+     * 
+ * + * HIGHMEM_XLARGE = 3; + */ + HIGHMEM_XLARGE(3), + /** + * + * + *
+     * Standard small.
+     * 
+ * + * STANDARD_SMALL = 4; + */ + STANDARD_SMALL(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * NODE_TYPE_UNSPECIFIED = 0; + */ + public static final int NODE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Shared core nano.
+     * 
+ * + * SHARED_CORE_NANO = 1; + */ + public static final int SHARED_CORE_NANO_VALUE = 1; + /** + * + * + *
+     * High memory medium.
+     * 
+ * + * HIGHMEM_MEDIUM = 2; + */ + public static final int HIGHMEM_MEDIUM_VALUE = 2; + /** + * + * + *
+     * High memory extra large.
+     * 
+ * + * HIGHMEM_XLARGE = 3; + */ + public static final int HIGHMEM_XLARGE_VALUE = 3; + /** + * + * + *
+     * Standard small.
+     * 
+ * + * STANDARD_SMALL = 4; + */ + public static final int STANDARD_SMALL_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 NodeType 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 NodeType forNumber(int value) { + switch (value) { + case 0: + return NODE_TYPE_UNSPECIFIED; + case 1: + return SHARED_CORE_NANO; + case 2: + return HIGHMEM_MEDIUM; + case 3: + return HIGHMEM_XLARGE; + case 4: + return STANDARD_SMALL; + 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 NodeType findValueByNumber(int number) { + return NodeType.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.memorystore.v1.Instance.getDescriptor().getEnumTypes().get(3); + } + + private static final NodeType[] VALUES = values(); + + public static NodeType 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 NodeType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.Instance.NodeType) + } + + /** + * + * + *
+   * The mode config, which is used to enable/disable cluster mode.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.Instance.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Mode is not specified.
+     * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is in standalone mode.
+     * 
+ * + * STANDALONE = 1; + */ + STANDALONE(1), + /** + * + * + *
+     * Instance is in cluster mode.
+     * 
+ * + * CLUSTER = 2; + */ + CLUSTER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Mode is not specified.
+     * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance is in standalone mode.
+     * 
+ * + * STANDALONE = 1; + */ + public static final int STANDALONE_VALUE = 1; + /** + * + * + *
+     * Instance is in cluster mode.
+     * 
+ * + * CLUSTER = 2; + */ + public static final int CLUSTER_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 Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return STANDALONE; + case 2: + return CLUSTER; + 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 Mode findValueByNumber(int number) { + return Mode.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.memorystore.v1.Instance.getDescriptor().getEnumTypes().get(4); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.Instance.Mode) + } + + public interface StateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.Instance.StateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateInfo field is set. + */ + boolean hasUpdateInfo(); + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateInfo. + */ + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo getUpdateInfo(); + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoOrBuilder getUpdateInfoOrBuilder(); + + com.google.cloud.memorystore.v1.Instance.StateInfo.InfoCase getInfoCase(); + } + /** + * + * + *
+   * Additional information about the state of the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.StateInfo} + */ + public static final class StateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.Instance.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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.StateInfo.class, + com.google.cloud.memorystore.v1.Instance.StateInfo.Builder.class); + } + + public interface UpdateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetShardCount field is set. + */ + boolean hasTargetShardCount(); + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetShardCount. + */ + int getTargetShardCount(); + + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetReplicaCount field is set. + */ + boolean hasTargetReplicaCount(); + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetReplicaCount. + */ + int getTargetReplicaCount(); + } + /** + * + * + *
+     * Represents information about instance with state UPDATING.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo} + */ + public static final class UpdateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.Instance.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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.class, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.Builder.class); + } + + private int bitField0_; + public static final int TARGET_SHARD_COUNT_FIELD_NUMBER = 1; + private int targetShardCount_ = 0; + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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.memorystore.v1.Instance.StateInfo.UpdateInfo)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo other = + (com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo.UpdateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo.UpdateInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo.UpdateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo.UpdateInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.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.memorystore.v1.Instance.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.memorystore.v1.Instance.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 instance with state UPDATING.
+       * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.class, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo build() { + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo buildPartial() { + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo result = + new com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo.UpdateInfo) { + return mergeFrom((com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo other) { + if (other + == com.google.cloud.memorystore.v1.Instance.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_; + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetShardCount. + */ + @java.lang.Override + public int getTargetShardCount() { + return targetShardCount_; + } + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The targetShardCount to set. + * @return This builder for chaining. + */ + public Builder setTargetShardCount(int value) { + + targetShardCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetShardCount() { + bitField0_ = (bitField0_ & ~0x00000001); + targetShardCount_ = 0; + onChanged(); + return this; + } + + private int targetReplicaCount_; + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetReplicaCount. + */ + @java.lang.Override + public int getTargetReplicaCount() { + return targetReplicaCount_; + } + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The targetReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setTargetReplicaCount(int value) { + + targetReplicaCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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.memorystore.v1.Instance.StateInfo.UpdateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) + private static final com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo(); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.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; + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo getUpdateInfo() { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.getDefaultInstance(); + } + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.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.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.Instance.StateInfo other = + (com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.StateInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.StateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.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; + } + /** + * + * + *
+     * Additional information about the state of the instance.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.StateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.Instance.StateInfo) + com.google.cloud.memorystore.v1.Instance.StateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.StateInfo.class, + com.google.cloud.memorystore.v1.Instance.StateInfo.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_StateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.Instance.StateInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo build() { + com.google.cloud.memorystore.v1.Instance.StateInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo buildPartial() { + com.google.cloud.memorystore.v1.Instance.StateInfo result = + new com.google.cloud.memorystore.v1.Instance.StateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.Instance.StateInfo result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo) { + return mergeFrom((com.google.cloud.memorystore.v1.Instance.StateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.Instance.StateInfo other) { + if (other == com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo.UpdateInfo, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.Builder, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoOrBuilder> + updateInfoBuilder_; + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo getUpdateInfo() { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.getDefaultInstance(); + } else { + if (infoCase_ == 1) { + return updateInfoBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.getDefaultInstance(); + } + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateInfo( + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + onChanged(); + } else { + updateInfoBuilder_.setMessage(value); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateInfo( + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.Builder builderForValue) { + if (updateInfoBuilder_ == null) { + info_ = builderForValue.build(); + onChanged(); + } else { + updateInfoBuilder_.setMessage(builderForValue.build()); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateInfo( + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1 + && info_ + != com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo + .getDefaultInstance()) { + info_ = + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.newBuilder( + (com.google.cloud.memorystore.v1.Instance.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; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.Builder + getUpdateInfoBuilder() { + return getUpdateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if ((infoCase_ == 1) && (updateInfoBuilder_ != null)) { + return updateInfoBuilder_.getMessageOrBuilder(); + } else { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.getDefaultInstance(); + } + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.Builder, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoOrBuilder> + getUpdateInfoFieldBuilder() { + if (updateInfoBuilder_ == null) { + if (!(infoCase_ == 1)) { + info_ = + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.getDefaultInstance(); + } + updateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfo.Builder, + com.google.cloud.memorystore.v1.Instance.StateInfo.UpdateInfoOrBuilder>( + (com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.Instance.StateInfo) + private static final com.google.cloud.memorystore.v1.Instance.StateInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.Instance.StateInfo(); + } + + public static com.google.cloud.memorystore.v1.Instance.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.memorystore.v1.Instance.StateInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InstanceEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.Instance.InstanceEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getConnectionsList(); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1.Instance.ConnectionDetail getConnections(int index); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getConnectionsCount(); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getConnectionsOrBuilderList(); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder getConnectionsOrBuilder( + int index); + } + /** + * + * + *
+   * InstanceEndpoint consists of PSC connections that are created
+   * as a group in each VPC network for accessing the instance. In each group,
+   * there shall be one connection for each service attachment in the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.InstanceEndpoint} + */ + public static final class InstanceEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.Instance.InstanceEndpoint) + InstanceEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use InstanceEndpoint.newBuilder() to construct. + private InstanceEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InstanceEndpoint() { + connections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InstanceEndpoint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.class, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder.class); + } + + public static final int CONNECTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List connections_; + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getConnectionsList() { + return connections_; + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder> + getConnectionsOrBuilderList() { + return connections_; + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getConnectionsCount() { + return connections_.size(); + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail getConnections(int index) { + return connections_.get(index); + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder + getConnectionsOrBuilder(int index) { + return connections_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < connections_.size(); i++) { + output.writeMessage(1, connections_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < connections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, connections_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.Instance.InstanceEndpoint)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint other = + (com.google.cloud.memorystore.v1.Instance.InstanceEndpoint) obj; + + if (!getConnectionsList().equals(other.getConnectionsList())) return false; + if (!getUnknownFields().equals(other.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 (getConnectionsCount() > 0) { + hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * InstanceEndpoint consists of PSC connections that are created
+     * as a group in each VPC network for accessing the instance. In each group,
+     * there shall be one connection for each service attachment in the cluster.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.InstanceEndpoint} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.Instance.InstanceEndpoint) + com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.class, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + } else { + connections_ = null; + connectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint build() { + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint buildPartial() { + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint result = + new com.google.cloud.memorystore.v1.Instance.InstanceEndpoint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint result) { + if (connectionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + connections_ = java.util.Collections.unmodifiableList(connections_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.connections_ = connections_; + } else { + result.connections_ = connectionsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.memorystore.v1.Instance.InstanceEndpoint result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1.Instance.InstanceEndpoint) { + return mergeFrom((com.google.cloud.memorystore.v1.Instance.InstanceEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.Instance.InstanceEndpoint other) { + if (other == com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.getDefaultInstance()) + return this; + if (connectionsBuilder_ == null) { + if (!other.connections_.isEmpty()) { + if (connections_.isEmpty()) { + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConnectionsIsMutable(); + connections_.addAll(other.connections_); + } + onChanged(); + } + } else { + if (!other.connections_.isEmpty()) { + if (connectionsBuilder_.isEmpty()) { + connectionsBuilder_.dispose(); + connectionsBuilder_ = null; + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + connectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConnectionsFieldBuilder() + : null; + } else { + connectionsBuilder_.addAllMessages(other.connections_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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.memorystore.v1.Instance.ConnectionDetail m = + input.readMessage( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.parser(), + extensionRegistry); + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(m); + } else { + connectionsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + connections_ = java.util.Collections.emptyList(); + + private void ensureConnectionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + connections_ = + new java.util.ArrayList( + connections_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.ConnectionDetail, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder, + com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder> + connectionsBuilder_; + + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getConnectionsList() { + if (connectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connections_); + } else { + return connectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getConnectionsCount() { + if (connectionsBuilder_ == null) { + return connections_.size(); + } else { + return connectionsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail getConnections(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnections( + int index, com.google.cloud.memorystore.v1.Instance.ConnectionDetail value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.set(index, value); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnections( + int index, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.set(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(value); + onChanged(); + } else { + connectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + int index, com.google.cloud.memorystore.v1.Instance.ConnectionDetail value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(index, value); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + int index, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllConnections( + java.lang.Iterable + values) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connections_); + onChanged(); + } else { + connectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearConnections() { + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + connectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeConnections(int index) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.remove(index); + onChanged(); + } else { + connectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder + getConnectionsBuilder(int index) { + return getConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder + getConnectionsOrBuilder(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder> + getConnectionsOrBuilderList() { + if (connectionsBuilder_ != null) { + return connectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(connections_); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder + addConnectionsBuilder() { + return getConnectionsFieldBuilder() + .addBuilder( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.getDefaultInstance()); + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder + addConnectionsBuilder(int index) { + return getConnectionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.getDefaultInstance()); + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getConnectionsBuilderList() { + return getConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.ConnectionDetail, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder, + com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder> + getConnectionsFieldBuilder() { + if (connectionsBuilder_ == null) { + connectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.ConnectionDetail, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder, + com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder>( + connections_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + connections_ = null; + } + return connectionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1.Instance.InstanceEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.Instance.InstanceEndpoint) + private static final com.google.cloud.memorystore.v1.Instance.InstanceEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.Instance.InstanceEndpoint(); + } + + public static com.google.cloud.memorystore.v1.Instance.InstanceEndpoint getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstanceEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.Instance.ConnectionDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + * + * @return Whether the pscAutoConnection field is set. + */ + boolean hasPscAutoConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + * + * @return The pscAutoConnection. + */ + com.google.cloud.memorystore.v1.PscAutoConnection getPscAutoConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder getPscAutoConnectionOrBuilder(); + + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + * + * @return Whether the pscConnection field is set. + */ + boolean hasPscConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + * + * @return The pscConnection. + */ + com.google.cloud.memorystore.v1.PscConnection getPscConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + com.google.cloud.memorystore.v1.PscConnectionOrBuilder getPscConnectionOrBuilder(); + + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.ConnectionCase getConnectionCase(); + } + /** + * + * + *
+   * Information of each PSC connection.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.ConnectionDetail} + */ + public static final class ConnectionDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.Instance.ConnectionDetail) + ConnectionDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionDetail.newBuilder() to construct. + private ConnectionDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.class, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder.class); + } + + private int connectionCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object connection_; + + public enum ConnectionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PSC_AUTO_CONNECTION(1), + PSC_CONNECTION(2), + CONNECTION_NOT_SET(0); + private final int value; + + private ConnectionCase(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 ConnectionCase valueOf(int value) { + return forNumber(value); + } + + public static ConnectionCase forNumber(int value) { + switch (value) { + case 1: + return PSC_AUTO_CONNECTION; + case 2: + return PSC_CONNECTION; + case 0: + return CONNECTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConnectionCase getConnectionCase() { + return ConnectionCase.forNumber(connectionCase_); + } + + public static final int PSC_AUTO_CONNECTION_FIELD_NUMBER = 1; + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + * + * @return Whether the pscAutoConnection field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnection() { + return connectionCase_ == 1; + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + * + * @return The pscAutoConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnection getPscAutoConnection() { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance(); + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder + getPscAutoConnectionOrBuilder() { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance(); + } + + public static final int PSC_CONNECTION_FIELD_NUMBER = 2; + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + * + * @return Whether the pscConnection field is set. + */ + @java.lang.Override + public boolean hasPscConnection() { + return connectionCase_ == 2; + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + * + * @return The pscConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnection getPscConnection() { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance(); + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnectionOrBuilder getPscConnectionOrBuilder() { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscConnection.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 (connectionCase_ == 1) { + output.writeMessage(1, (com.google.cloud.memorystore.v1.PscAutoConnection) connection_); + } + if (connectionCase_ == 2) { + output.writeMessage(2, (com.google.cloud.memorystore.v1.PscConnection) connection_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (connectionCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.memorystore.v1.PscAutoConnection) connection_); + } + if (connectionCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.memorystore.v1.PscConnection) connection_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.Instance.ConnectionDetail)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.Instance.ConnectionDetail other = + (com.google.cloud.memorystore.v1.Instance.ConnectionDetail) obj; + + if (!getConnectionCase().equals(other.getConnectionCase())) return false; + switch (connectionCase_) { + case 1: + if (!getPscAutoConnection().equals(other.getPscAutoConnection())) return false; + break; + case 2: + if (!getPscConnection().equals(other.getPscConnection())) 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 (connectionCase_) { + case 1: + hash = (37 * hash) + PSC_AUTO_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnection().hashCode(); + break; + case 2: + hash = (37 * hash) + PSC_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getPscConnection().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Information of each PSC connection.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance.ConnectionDetail} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.Instance.ConnectionDetail) + com.google.cloud.memorystore.v1.Instance.ConnectionDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.class, + com.google.cloud.memorystore.v1.Instance.ConnectionDetail.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.Instance.ConnectionDetail.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (pscAutoConnectionBuilder_ != null) { + pscAutoConnectionBuilder_.clear(); + } + if (pscConnectionBuilder_ != null) { + pscConnectionBuilder_.clear(); + } + connectionCase_ = 0; + connection_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.Instance.ConnectionDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail build() { + com.google.cloud.memorystore.v1.Instance.ConnectionDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail buildPartial() { + com.google.cloud.memorystore.v1.Instance.ConnectionDetail result = + new com.google.cloud.memorystore.v1.Instance.ConnectionDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.Instance.ConnectionDetail result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.memorystore.v1.Instance.ConnectionDetail result) { + result.connectionCase_ = connectionCase_; + result.connection_ = this.connection_; + if (connectionCase_ == 1 && pscAutoConnectionBuilder_ != null) { + result.connection_ = pscAutoConnectionBuilder_.build(); + } + if (connectionCase_ == 2 && pscConnectionBuilder_ != null) { + result.connection_ = pscConnectionBuilder_.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.memorystore.v1.Instance.ConnectionDetail) { + return mergeFrom((com.google.cloud.memorystore.v1.Instance.ConnectionDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.Instance.ConnectionDetail other) { + if (other == com.google.cloud.memorystore.v1.Instance.ConnectionDetail.getDefaultInstance()) + return this; + switch (other.getConnectionCase()) { + case PSC_AUTO_CONNECTION: + { + mergePscAutoConnection(other.getPscAutoConnection()); + break; + } + case PSC_CONNECTION: + { + mergePscConnection(other.getPscConnection()); + break; + } + case CONNECTION_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( + getPscAutoConnectionFieldBuilder().getBuilder(), extensionRegistry); + connectionCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getPscConnectionFieldBuilder().getBuilder(), extensionRegistry); + connectionCase_ = 2; + 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 connectionCase_ = 0; + private java.lang.Object connection_; + + public ConnectionCase getConnectionCase() { + return ConnectionCase.forNumber(connectionCase_); + } + + public Builder clearConnection() { + connectionCase_ = 0; + connection_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PscAutoConnection, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder> + pscAutoConnectionBuilder_; + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + * + * @return Whether the pscAutoConnection field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnection() { + return connectionCase_ == 1; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + * + * @return The pscAutoConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnection getPscAutoConnection() { + if (pscAutoConnectionBuilder_ == null) { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance(); + } else { + if (connectionCase_ == 1) { + return pscAutoConnectionBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + public Builder setPscAutoConnection(com.google.cloud.memorystore.v1.PscAutoConnection value) { + if (pscAutoConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + pscAutoConnectionBuilder_.setMessage(value); + } + connectionCase_ = 1; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + public Builder setPscAutoConnection( + com.google.cloud.memorystore.v1.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + pscAutoConnectionBuilder_.setMessage(builderForValue.build()); + } + connectionCase_ = 1; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + public Builder mergePscAutoConnection( + com.google.cloud.memorystore.v1.PscAutoConnection value) { + if (pscAutoConnectionBuilder_ == null) { + if (connectionCase_ == 1 + && connection_ + != com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance()) { + connection_ = + com.google.cloud.memorystore.v1.PscAutoConnection.newBuilder( + (com.google.cloud.memorystore.v1.PscAutoConnection) connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + if (connectionCase_ == 1) { + pscAutoConnectionBuilder_.mergeFrom(value); + } else { + pscAutoConnectionBuilder_.setMessage(value); + } + } + connectionCase_ = 1; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + public Builder clearPscAutoConnection() { + if (pscAutoConnectionBuilder_ == null) { + if (connectionCase_ == 1) { + connectionCase_ = 0; + connection_ = null; + onChanged(); + } + } else { + if (connectionCase_ == 1) { + connectionCase_ = 0; + connection_ = null; + } + pscAutoConnectionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + public com.google.cloud.memorystore.v1.PscAutoConnection.Builder + getPscAutoConnectionBuilder() { + return getPscAutoConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder + getPscAutoConnectionOrBuilder() { + if ((connectionCase_ == 1) && (pscAutoConnectionBuilder_ != null)) { + return pscAutoConnectionBuilder_.getMessageOrBuilder(); + } else { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connection = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PscAutoConnection, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder> + getPscAutoConnectionFieldBuilder() { + if (pscAutoConnectionBuilder_ == null) { + if (!(connectionCase_ == 1)) { + connection_ = com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance(); + } + pscAutoConnectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PscAutoConnection, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder>( + (com.google.cloud.memorystore.v1.PscAutoConnection) connection_, + getParentForChildren(), + isClean()); + connection_ = null; + } + connectionCase_ = 1; + onChanged(); + return pscAutoConnectionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PscConnection, + com.google.cloud.memorystore.v1.PscConnection.Builder, + com.google.cloud.memorystore.v1.PscConnectionOrBuilder> + pscConnectionBuilder_; + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + * + * @return Whether the pscConnection field is set. + */ + @java.lang.Override + public boolean hasPscConnection() { + return connectionCase_ == 2; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + * + * @return The pscConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnection getPscConnection() { + if (pscConnectionBuilder_ == null) { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance(); + } else { + if (connectionCase_ == 2) { + return pscConnectionBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + public Builder setPscConnection(com.google.cloud.memorystore.v1.PscConnection value) { + if (pscConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + pscConnectionBuilder_.setMessage(value); + } + connectionCase_ = 2; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + public Builder setPscConnection( + com.google.cloud.memorystore.v1.PscConnection.Builder builderForValue) { + if (pscConnectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + pscConnectionBuilder_.setMessage(builderForValue.build()); + } + connectionCase_ = 2; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + public Builder mergePscConnection(com.google.cloud.memorystore.v1.PscConnection value) { + if (pscConnectionBuilder_ == null) { + if (connectionCase_ == 2 + && connection_ + != com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance()) { + connection_ = + com.google.cloud.memorystore.v1.PscConnection.newBuilder( + (com.google.cloud.memorystore.v1.PscConnection) connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + if (connectionCase_ == 2) { + pscConnectionBuilder_.mergeFrom(value); + } else { + pscConnectionBuilder_.setMessage(value); + } + } + connectionCase_ = 2; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + public Builder clearPscConnection() { + if (pscConnectionBuilder_ == null) { + if (connectionCase_ == 2) { + connectionCase_ = 0; + connection_ = null; + onChanged(); + } + } else { + if (connectionCase_ == 2) { + connectionCase_ = 0; + connection_ = null; + } + pscConnectionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + public com.google.cloud.memorystore.v1.PscConnection.Builder getPscConnectionBuilder() { + return getPscConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnectionOrBuilder getPscConnectionOrBuilder() { + if ((connectionCase_ == 2) && (pscConnectionBuilder_ != null)) { + return pscConnectionBuilder_.getMessageOrBuilder(); + } else { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1.PscConnection psc_connection = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PscConnection, + com.google.cloud.memorystore.v1.PscConnection.Builder, + com.google.cloud.memorystore.v1.PscConnectionOrBuilder> + getPscConnectionFieldBuilder() { + if (pscConnectionBuilder_ == null) { + if (!(connectionCase_ == 2)) { + connection_ = com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance(); + } + pscConnectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PscConnection, + com.google.cloud.memorystore.v1.PscConnection.Builder, + com.google.cloud.memorystore.v1.PscConnectionOrBuilder>( + (com.google.cloud.memorystore.v1.PscConnection) connection_, + getParentForChildren(), + isClean()); + connection_ = null; + } + connectionCase_ = 2; + onChanged(); + return pscConnectionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1.Instance.ConnectionDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.Instance.ConnectionDetail) + private static final com.google.cloud.memorystore.v1.Instance.ConnectionDetail DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.Instance.ConnectionDetail(); + } + + public static com.google.cloud.memorystore.v1.Instance.ConnectionDetail getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.ConnectionDetail getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_ = 0; + /** + * + * + *
+   * Output only. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.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. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.State getState() { + com.google.cloud.memorystore.v1.Instance.State result = + com.google.cloud.memorystore.v1.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.memorystore.v1.Instance.State.UNRECOGNIZED : result; + } + + public static final int STATE_INFO_FIELD_NUMBER = 6; + private com.google.cloud.memorystore.v1.Instance.StateInfo stateInfo_; + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + @java.lang.Override + public boolean hasStateInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfo getStateInfo() { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.StateInfoOrBuilder getStateInfoOrBuilder() { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } + + public static final int UID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. System assigned, unique identifier for the instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * 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_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Optional. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * 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 = 9; + private int authorizationMode_ = 0; + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.AuthorizationMode getAuthorizationMode() { + com.google.cloud.memorystore.v1.Instance.AuthorizationMode result = + com.google.cloud.memorystore.v1.Instance.AuthorizationMode.forNumber(authorizationMode_); + return result == null + ? com.google.cloud.memorystore.v1.Instance.AuthorizationMode.UNRECOGNIZED + : result; + } + + public static final int TRANSIT_ENCRYPTION_MODE_FIELD_NUMBER = 10; + private int transitEncryptionMode_ = 0; + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode getTransitEncryptionMode() { + com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode result = + com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode.forNumber( + transitEncryptionMode_); + return result == null + ? com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode.UNRECOGNIZED + : result; + } + + public static final int SHARD_COUNT_FIELD_NUMBER = 11; + private int shardCount_ = 0; + /** + * + * + *
+   * Optional. Number of shards for the instance.
+   * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + + public static final int DISCOVERY_ENDPOINTS_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private java.util.List discoveryEndpoints_; + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsOrBuilderList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDiscoveryEndpointsCount() { + return discoveryEndpoints_.size(); + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.DiscoveryEndpoint getDiscoveryEndpoints(int index) { + return discoveryEndpoints_.get(index); + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.DiscoveryEndpointOrBuilder getDiscoveryEndpointsOrBuilder( + int index) { + return discoveryEndpoints_.get(index); + } + + public static final int NODE_TYPE_FIELD_NUMBER = 13; + private int nodeType_ = 0; + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeType. + */ + @java.lang.Override + public int getNodeTypeValue() { + return nodeType_; + } + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.NodeType getNodeType() { + com.google.cloud.memorystore.v1.Instance.NodeType result = + com.google.cloud.memorystore.v1.Instance.NodeType.forNumber(nodeType_); + return result == null ? com.google.cloud.memorystore.v1.Instance.NodeType.UNRECOGNIZED : result; + } + + public static final int PERSISTENCE_CONFIG_FIELD_NUMBER = 14; + private com.google.cloud.memorystore.v1.PersistenceConfig persistenceConfig_; + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the persistenceConfig field is set. + */ + @java.lang.Override + public boolean hasPersistenceConfig() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The persistenceConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig getPersistenceConfig() { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfigOrBuilder + getPersistenceConfigOrBuilder() { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } + + public static final int ENGINE_VERSION_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object engineVersion_ = ""; + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The engineVersion. + */ + @java.lang.Override + public java.lang.String getEngineVersion() { + java.lang.Object ref = engineVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + engineVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for engineVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEngineVersionBytes() { + java.lang.Object ref = engineVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + engineVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENGINE_CONFIGS_FIELD_NUMBER = 16; + + private static final class EngineConfigsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_EngineConfigsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField engineConfigs_; + + private com.google.protobuf.MapField + internalGetEngineConfigs() { + if (engineConfigs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EngineConfigsDefaultEntryHolder.defaultEntry); + } + return engineConfigs_; + } + + public int getEngineConfigsCount() { + return internalGetEngineConfigs().getMap().size(); + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsEngineConfigs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEngineConfigs().getMap().containsKey(key); + } + /** Use {@link #getEngineConfigsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEngineConfigs() { + return getEngineConfigsMap(); + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getEngineConfigsMap() { + return internalGetEngineConfigs().getMap(); + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getEngineConfigsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getEngineConfigsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NODE_CONFIG_FIELD_NUMBER = 17; + private com.google.cloud.memorystore.v1.NodeConfig nodeConfig_; + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nodeConfig field is set. + */ + @java.lang.Override + public boolean hasNodeConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nodeConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.NodeConfig getNodeConfig() { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1.NodeConfig.getDefaultInstance() + : nodeConfig_; + } + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.NodeConfigOrBuilder getNodeConfigOrBuilder() { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1.NodeConfig.getDefaultInstance() + : nodeConfig_; + } + + public static final int ZONE_DISTRIBUTION_CONFIG_FIELD_NUMBER = 18; + private com.google.cloud.memorystore.v1.ZoneDistributionConfig zoneDistributionConfig_; + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the zoneDistributionConfig field is set. + */ + @java.lang.Override + public boolean hasZoneDistributionConfig() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The zoneDistributionConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfig getZoneDistributionConfig() { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfigOrBuilder + getZoneDistributionConfigOrBuilder() { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } + + public static final int DELETION_PROTECTION_ENABLED_FIELD_NUMBER = 19; + private boolean deletionProtectionEnabled_ = false; + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the deletionProtectionEnabled field is set. + */ + @java.lang.Override + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The deletionProtectionEnabled. + */ + @java.lang.Override + public boolean getDeletionProtectionEnabled() { + return deletionProtectionEnabled_; + } + + public static final int PSC_AUTO_CONNECTIONS_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private java.util.List pscAutoConnections_; + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsList() { + return pscAutoConnections_; + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsOrBuilderList() { + return pscAutoConnections_; + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public int getPscAutoConnectionsCount() { + return pscAutoConnections_.size(); + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnection getPscAutoConnections(int index) { + return pscAutoConnections_.get(index); + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder getPscAutoConnectionsOrBuilder( + int index) { + return pscAutoConnections_.get(index); + } + + public static final int ENDPOINTS_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") + private java.util.List endpoints_; + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder> + getEndpointsOrBuilderList() { + return endpoints_; + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder getEndpointsOrBuilder( + int index) { + return endpoints_.get(index); + } + + public static final int MODE_FIELD_NUMBER = 26; + private int mode_ = 0; + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.Mode getMode() { + com.google.cloud.memorystore.v1.Instance.Mode result = + com.google.cloud.memorystore.v1.Instance.Mode.forNumber(mode_); + return result == null ? com.google.cloud.memorystore.v1.Instance.Mode.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (state_ != com.google.cloud.memorystore.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getStateInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, uid_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt32(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.memorystore.v1.Instance.AuthorizationMode.AUTHORIZATION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, transitEncryptionMode_); + } + if (shardCount_ != 0) { + output.writeInt32(11, shardCount_); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + output.writeMessage(12, discoveryEndpoints_.get(i)); + } + if (nodeType_ + != com.google.cloud.memorystore.v1.Instance.NodeType.NODE_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(13, nodeType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(14, getPersistenceConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(engineVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, engineVersion_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetEngineConfigs(), EngineConfigsDefaultEntryHolder.defaultEntry, 16); + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(17, getNodeConfig()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(18, getZoneDistributionConfig()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeBool(19, deletionProtectionEnabled_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + output.writeMessage(20, pscAutoConnections_.get(i)); + } + for (int i = 0; i < endpoints_.size(); i++) { + output.writeMessage(25, endpoints_.get(i)); + } + if (mode_ != com.google.cloud.memorystore.v1.Instance.Mode.MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(26, mode_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (state_ != com.google.cloud.memorystore.v1.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStateInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, uid_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.memorystore.v1.Instance.AuthorizationMode.AUTHORIZATION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, transitEncryptionMode_); + } + if (shardCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, shardCount_); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(12, discoveryEndpoints_.get(i)); + } + if (nodeType_ + != com.google.cloud.memorystore.v1.Instance.NodeType.NODE_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, nodeType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPersistenceConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(engineVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, engineVersion_); + } + for (java.util.Map.Entry entry : + internalGetEngineConfigs().getMap().entrySet()) { + com.google.protobuf.MapEntry engineConfigs__ = + EngineConfigsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, engineConfigs__); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getNodeConfig()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(18, getZoneDistributionConfig()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, deletionProtectionEnabled_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(20, pscAutoConnections_.get(i)); + } + for (int i = 0; i < endpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, endpoints_.get(i)); + } + if (mode_ != com.google.cloud.memorystore.v1.Instance.Mode.MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(26, mode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.Instance)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.Instance other = (com.google.cloud.memorystore.v1.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (hasStateInfo() != other.hasStateInfo()) return false; + if (hasStateInfo()) { + if (!getStateInfo().equals(other.getStateInfo())) 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 (getShardCount() != other.getShardCount()) return false; + if (!getDiscoveryEndpointsList().equals(other.getDiscoveryEndpointsList())) return false; + if (nodeType_ != other.nodeType_) return false; + if (hasPersistenceConfig() != other.hasPersistenceConfig()) return false; + if (hasPersistenceConfig()) { + if (!getPersistenceConfig().equals(other.getPersistenceConfig())) return false; + } + if (!getEngineVersion().equals(other.getEngineVersion())) return false; + if (!internalGetEngineConfigs().equals(other.internalGetEngineConfigs())) return false; + if (hasNodeConfig() != other.hasNodeConfig()) return false; + if (hasNodeConfig()) { + if (!getNodeConfig().equals(other.getNodeConfig())) return false; + } + if (hasZoneDistributionConfig() != other.hasZoneDistributionConfig()) return false; + if (hasZoneDistributionConfig()) { + if (!getZoneDistributionConfig().equals(other.getZoneDistributionConfig())) return false; + } + if (hasDeletionProtectionEnabled() != other.hasDeletionProtectionEnabled()) return false; + if (hasDeletionProtectionEnabled()) { + if (getDeletionProtectionEnabled() != other.getDeletionProtectionEnabled()) return false; + } + if (!getPscAutoConnectionsList().equals(other.getPscAutoConnectionsList())) return false; + if (!getEndpointsList().equals(other.getEndpointsList())) return false; + if (mode_ != other.mode_) return false; + if (!getUnknownFields().equals(other.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(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasStateInfo()) { + hash = (37 * hash) + STATE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getStateInfo().hashCode(); + } + 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_; + hash = (37 * hash) + SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getShardCount(); + if (getDiscoveryEndpointsCount() > 0) { + hash = (37 * hash) + DISCOVERY_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getDiscoveryEndpointsList().hashCode(); + } + hash = (37 * hash) + NODE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + nodeType_; + if (hasPersistenceConfig()) { + hash = (37 * hash) + PERSISTENCE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPersistenceConfig().hashCode(); + } + hash = (37 * hash) + ENGINE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getEngineVersion().hashCode(); + if (!internalGetEngineConfigs().getMap().isEmpty()) { + hash = (37 * hash) + ENGINE_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetEngineConfigs().hashCode(); + } + if (hasNodeConfig()) { + hash = (37 * hash) + NODE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNodeConfig().hashCode(); + } + if (hasZoneDistributionConfig()) { + hash = (37 * hash) + ZONE_DISTRIBUTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getZoneDistributionConfig().hashCode(); + } + if (hasDeletionProtectionEnabled()) { + hash = (37 * hash) + DELETION_PROTECTION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeletionProtectionEnabled()); + } + if (getPscAutoConnectionsCount() > 0) { + hash = (37 * hash) + PSC_AUTO_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnectionsList().hashCode(); + } + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.Instance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1.Instance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Memorystore instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.Instance) + com.google.cloud.memorystore.v1.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetLabels(); + case 16: + return internalGetEngineConfigs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + case 16: + return internalGetMutableEngineConfigs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.Instance.class, + com.google.cloud.memorystore.v1.Instance.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.Instance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getStateInfoFieldBuilder(); + getDiscoveryEndpointsFieldBuilder(); + getPersistenceConfigFieldBuilder(); + getNodeConfigFieldBuilder(); + getZoneDistributionConfigFieldBuilder(); + getPscAutoConnectionsFieldBuilder(); + getEndpointsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + uid_ = ""; + replicaCount_ = 0; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + shardCount_ = 0; + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + } else { + discoveryEndpoints_ = null; + discoveryEndpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + nodeType_ = 0; + persistenceConfig_ = null; + if (persistenceConfigBuilder_ != null) { + persistenceConfigBuilder_.dispose(); + persistenceConfigBuilder_ = null; + } + engineVersion_ = ""; + internalGetMutableEngineConfigs().clear(); + nodeConfig_ = null; + if (nodeConfigBuilder_ != null) { + nodeConfigBuilder_.dispose(); + nodeConfigBuilder_ = null; + } + zoneDistributionConfig_ = null; + if (zoneDistributionConfigBuilder_ != null) { + zoneDistributionConfigBuilder_.dispose(); + zoneDistributionConfigBuilder_ = null; + } + deletionProtectionEnabled_ = false; + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + } else { + pscAutoConnections_ = null; + pscAutoConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00080000); + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + } else { + endpoints_ = null; + endpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00100000); + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance build() { + com.google.cloud.memorystore.v1.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance buildPartial() { + com.google.cloud.memorystore.v1.Instance result = + new com.google.cloud.memorystore.v1.Instance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.memorystore.v1.Instance result) { + if (discoveryEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + discoveryEndpoints_ = java.util.Collections.unmodifiableList(discoveryEndpoints_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.discoveryEndpoints_ = discoveryEndpoints_; + } else { + result.discoveryEndpoints_ = discoveryEndpointsBuilder_.build(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0)) { + pscAutoConnections_ = java.util.Collections.unmodifiableList(pscAutoConnections_); + bitField0_ = (bitField0_ & ~0x00080000); + } + result.pscAutoConnections_ = pscAutoConnections_; + } else { + result.pscAutoConnections_ = pscAutoConnectionsBuilder_.build(); + } + if (endpointsBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0)) { + endpoints_ = java.util.Collections.unmodifiableList(endpoints_); + bitField0_ = (bitField0_ & ~0x00100000); + } + result.endpoints_ = endpoints_; + } else { + result.endpoints_ = endpointsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.memorystore.v1.Instance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.stateInfo_ = stateInfoBuilder_ == null ? stateInfo_ : stateInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.replicaCount_ = replicaCount_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.authorizationMode_ = authorizationMode_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.transitEncryptionMode_ = transitEncryptionMode_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.shardCount_ = shardCount_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.nodeType_ = nodeType_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.persistenceConfig_ = + persistenceConfigBuilder_ == null + ? persistenceConfig_ + : persistenceConfigBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.engineVersion_ = engineVersion_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.engineConfigs_ = internalGetEngineConfigs(); + result.engineConfigs_.makeImmutable(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.nodeConfig_ = nodeConfigBuilder_ == null ? nodeConfig_ : nodeConfigBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.zoneDistributionConfig_ = + zoneDistributionConfigBuilder_ == null + ? zoneDistributionConfig_ + : zoneDistributionConfigBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.deletionProtectionEnabled_ = deletionProtectionEnabled_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.mode_ = mode_; + } + 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.memorystore.v1.Instance) { + return mergeFrom((com.google.cloud.memorystore.v1.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.Instance other) { + if (other == com.google.cloud.memorystore.v1.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasStateInfo()) { + mergeStateInfo(other.getStateInfo()); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasReplicaCount()) { + setReplicaCount(other.getReplicaCount()); + } + if (other.authorizationMode_ != 0) { + setAuthorizationModeValue(other.getAuthorizationModeValue()); + } + if (other.transitEncryptionMode_ != 0) { + setTransitEncryptionModeValue(other.getTransitEncryptionModeValue()); + } + if (other.getShardCount() != 0) { + setShardCount(other.getShardCount()); + } + if (discoveryEndpointsBuilder_ == null) { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpoints_.isEmpty()) { + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.addAll(other.discoveryEndpoints_); + } + onChanged(); + } + } else { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpointsBuilder_.isEmpty()) { + discoveryEndpointsBuilder_.dispose(); + discoveryEndpointsBuilder_ = null; + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000800); + discoveryEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDiscoveryEndpointsFieldBuilder() + : null; + } else { + discoveryEndpointsBuilder_.addAllMessages(other.discoveryEndpoints_); + } + } + } + if (other.nodeType_ != 0) { + setNodeTypeValue(other.getNodeTypeValue()); + } + if (other.hasPersistenceConfig()) { + mergePersistenceConfig(other.getPersistenceConfig()); + } + if (!other.getEngineVersion().isEmpty()) { + engineVersion_ = other.engineVersion_; + bitField0_ |= 0x00004000; + onChanged(); + } + internalGetMutableEngineConfigs().mergeFrom(other.internalGetEngineConfigs()); + bitField0_ |= 0x00008000; + if (other.hasNodeConfig()) { + mergeNodeConfig(other.getNodeConfig()); + } + if (other.hasZoneDistributionConfig()) { + mergeZoneDistributionConfig(other.getZoneDistributionConfig()); + } + if (other.hasDeletionProtectionEnabled()) { + setDeletionProtectionEnabled(other.getDeletionProtectionEnabled()); + } + if (pscAutoConnectionsBuilder_ == null) { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnections_.isEmpty()) { + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00080000); + } else { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.addAll(other.pscAutoConnections_); + } + onChanged(); + } + } else { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnectionsBuilder_.isEmpty()) { + pscAutoConnectionsBuilder_.dispose(); + pscAutoConnectionsBuilder_ = null; + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00080000); + pscAutoConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPscAutoConnectionsFieldBuilder() + : null; + } else { + pscAutoConnectionsBuilder_.addAllMessages(other.pscAutoConnections_); + } + } + } + if (endpointsBuilder_ == null) { + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00100000); + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + } else { + if (!other.endpoints_.isEmpty()) { + if (endpointsBuilder_.isEmpty()) { + endpointsBuilder_.dispose(); + endpointsBuilder_ = null; + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00100000); + endpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEndpointsFieldBuilder() + : null; + } else { + endpointsBuilder_.addAllMessages(other.endpoints_); + } + } + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + input.readMessage(getStateInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + replicaCount_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + authorizationMode_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: + { + transitEncryptionMode_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: + { + shardCount_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 98: + { + com.google.cloud.memorystore.v1.DiscoveryEndpoint m = + input.readMessage( + com.google.cloud.memorystore.v1.DiscoveryEndpoint.parser(), + extensionRegistry); + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(m); + } else { + discoveryEndpointsBuilder_.addMessage(m); + } + break; + } // case 98 + case 104: + { + nodeType_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: + { + input.readMessage( + getPersistenceConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + engineVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 130: + { + com.google.protobuf.MapEntry engineConfigs__ = + input.readMessage( + EngineConfigsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableEngineConfigs() + .getMutableMap() + .put(engineConfigs__.getKey(), engineConfigs__.getValue()); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 138: + { + input.readMessage(getNodeConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: + { + input.readMessage( + getZoneDistributionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 152: + { + deletionProtectionEnabled_ = input.readBool(); + bitField0_ |= 0x00040000; + break; + } // case 152 + case 162: + { + com.google.cloud.memorystore.v1.PscAutoConnection m = + input.readMessage( + com.google.cloud.memorystore.v1.PscAutoConnection.parser(), + extensionRegistry); + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(m); + } else { + pscAutoConnectionsBuilder_.addMessage(m); + } + break; + } // case 162 + case 202: + { + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint m = + input.readMessage( + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.parser(), + extensionRegistry); + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(m); + } else { + endpointsBuilder_.addMessage(m); + } + break; + } // case 202 + case 208: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00200000; + break; + } // case 208 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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_ = ""; + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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); + } + if (createTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000008; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.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. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.State getState() { + com.google.cloud.memorystore.v1.Instance.State result = + com.google.cloud.memorystore.v1.Instance.State.forNumber(state_); + return result == null ? com.google.cloud.memorystore.v1.Instance.State.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.memorystore.v1.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000010); + state_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1.Instance.StateInfo stateInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.StateInfo, + com.google.cloud.memorystore.v1.Instance.StateInfo.Builder, + com.google.cloud.memorystore.v1.Instance.StateInfoOrBuilder> + stateInfoBuilder_; + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + public boolean hasStateInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + public com.google.cloud.memorystore.v1.Instance.StateInfo getStateInfo() { + if (stateInfoBuilder_ == null) { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } else { + return stateInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo(com.google.cloud.memorystore.v1.Instance.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateInfo_ = value; + } else { + stateInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo( + com.google.cloud.memorystore.v1.Instance.StateInfo.Builder builderForValue) { + if (stateInfoBuilder_ == null) { + stateInfo_ = builderForValue.build(); + } else { + stateInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStateInfo(com.google.cloud.memorystore.v1.Instance.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && stateInfo_ != null + && stateInfo_ + != com.google.cloud.memorystore.v1.Instance.StateInfo.getDefaultInstance()) { + getStateInfoBuilder().mergeFrom(value); + } else { + stateInfo_ = value; + } + } else { + stateInfoBuilder_.mergeFrom(value); + } + if (stateInfo_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateInfo() { + bitField0_ = (bitField0_ & ~0x00000020); + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.Instance.StateInfo.Builder getStateInfoBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getStateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.Instance.StateInfoOrBuilder getStateInfoOrBuilder() { + if (stateInfoBuilder_ != null) { + return stateInfoBuilder_.getMessageOrBuilder(); + } else { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.StateInfo, + com.google.cloud.memorystore.v1.Instance.StateInfo.Builder, + com.google.cloud.memorystore.v1.Instance.StateInfoOrBuilder> + getStateInfoFieldBuilder() { + if (stateInfoBuilder_ == null) { + stateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.StateInfo, + com.google.cloud.memorystore.v1.Instance.StateInfo.Builder, + com.google.cloud.memorystore.v1.Instance.StateInfoOrBuilder>( + getStateInfo(), getParentForChildren(), isClean()); + stateInfo_ = null; + } + return stateInfoBuilder_; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. System assigned, unique identifier for the instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000040; + onChanged(); + return this; + } + + private int replicaCount_; + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * 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_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + @java.lang.Override + public int getReplicaCount() { + return replicaCount_; + } + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * 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_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000080); + replicaCount_ = 0; + onChanged(); + return this; + } + + private int authorizationMode_ = 0; + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.AuthorizationMode getAuthorizationMode() { + com.google.cloud.memorystore.v1.Instance.AuthorizationMode result = + com.google.cloud.memorystore.v1.Instance.AuthorizationMode.forNumber(authorizationMode_); + return result == null + ? com.google.cloud.memorystore.v1.Instance.AuthorizationMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The authorizationMode to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationMode( + com.google.cloud.memorystore.v1.Instance.AuthorizationMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + authorizationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizationMode() { + bitField0_ = (bitField0_ & ~0x00000100); + authorizationMode_ = 0; + onChanged(); + return this; + } + + private int transitEncryptionMode_ = 0; + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode + getTransitEncryptionMode() { + com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode result = + com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode.forNumber( + transitEncryptionMode_); + return result == null + ? com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The transitEncryptionMode to set. + * @return This builder for chaining. + */ + public Builder setTransitEncryptionMode( + com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + transitEncryptionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransitEncryptionMode() { + bitField0_ = (bitField0_ & ~0x00000200); + transitEncryptionMode_ = 0; + onChanged(); + return this; + } + + private int shardCount_; + /** + * + * + *
+     * Optional. Number of shards for the instance.
+     * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + /** + * + * + *
+     * Optional. Number of shards for the instance.
+     * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The shardCount to set. + * @return This builder for chaining. + */ + public Builder setShardCount(int value) { + + shardCount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Number of shards for the instance.
+     * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearShardCount() { + bitField0_ = (bitField0_ & ~0x00000400); + shardCount_ = 0; + onChanged(); + return this; + } + + private java.util.List discoveryEndpoints_ = + java.util.Collections.emptyList(); + + private void ensureDiscoveryEndpointsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + discoveryEndpoints_ = + new java.util.ArrayList( + discoveryEndpoints_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.DiscoveryEndpoint, + com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder, + com.google.cloud.memorystore.v1.DiscoveryEndpointOrBuilder> + discoveryEndpointsBuilder_; + + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDiscoveryEndpointsCount() { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.size(); + } else { + return discoveryEndpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.DiscoveryEndpoint getDiscoveryEndpoints(int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, com.google.cloud.memorystore.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, com.google.cloud.memorystore.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints(com.google.cloud.memorystore.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, com.google.cloud.memorystore.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, com.google.cloud.memorystore.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDiscoveryEndpoints() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + discoveryEndpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder getDiscoveryEndpointsBuilder( + int index) { + return getDiscoveryEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.DiscoveryEndpointOrBuilder + getDiscoveryEndpointsOrBuilder(int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder + addDiscoveryEndpointsBuilder() { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder(com.google.cloud.memorystore.v1.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder addDiscoveryEndpointsBuilder( + int index) { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder( + index, com.google.cloud.memorystore.v1.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDiscoveryEndpointsBuilderList() { + return getDiscoveryEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.DiscoveryEndpoint, + com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder, + com.google.cloud.memorystore.v1.DiscoveryEndpointOrBuilder> + getDiscoveryEndpointsFieldBuilder() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.DiscoveryEndpoint, + com.google.cloud.memorystore.v1.DiscoveryEndpoint.Builder, + com.google.cloud.memorystore.v1.DiscoveryEndpointOrBuilder>( + discoveryEndpoints_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + discoveryEndpoints_ = null; + } + return discoveryEndpointsBuilder_; + } + + private int nodeType_ = 0; + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeType. + */ + @java.lang.Override + public int getNodeTypeValue() { + return nodeType_; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for nodeType to set. + * @return This builder for chaining. + */ + public Builder setNodeTypeValue(int value) { + nodeType_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.NodeType getNodeType() { + com.google.cloud.memorystore.v1.Instance.NodeType result = + com.google.cloud.memorystore.v1.Instance.NodeType.forNumber(nodeType_); + return result == null + ? com.google.cloud.memorystore.v1.Instance.NodeType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The nodeType to set. + * @return This builder for chaining. + */ + public Builder setNodeType(com.google.cloud.memorystore.v1.Instance.NodeType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + nodeType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNodeType() { + bitField0_ = (bitField0_ & ~0x00001000); + nodeType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1.PersistenceConfig persistenceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfigOrBuilder> + persistenceConfigBuilder_; + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the persistenceConfig field is set. + */ + public boolean hasPersistenceConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The persistenceConfig. + */ + public com.google.cloud.memorystore.v1.PersistenceConfig getPersistenceConfig() { + if (persistenceConfigBuilder_ == null) { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } else { + return persistenceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPersistenceConfig(com.google.cloud.memorystore.v1.PersistenceConfig value) { + if (persistenceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + persistenceConfig_ = value; + } else { + persistenceConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPersistenceConfig( + com.google.cloud.memorystore.v1.PersistenceConfig.Builder builderForValue) { + if (persistenceConfigBuilder_ == null) { + persistenceConfig_ = builderForValue.build(); + } else { + persistenceConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePersistenceConfig(com.google.cloud.memorystore.v1.PersistenceConfig value) { + if (persistenceConfigBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && persistenceConfig_ != null + && persistenceConfig_ + != com.google.cloud.memorystore.v1.PersistenceConfig.getDefaultInstance()) { + getPersistenceConfigBuilder().mergeFrom(value); + } else { + persistenceConfig_ = value; + } + } else { + persistenceConfigBuilder_.mergeFrom(value); + } + if (persistenceConfig_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPersistenceConfig() { + bitField0_ = (bitField0_ & ~0x00002000); + persistenceConfig_ = null; + if (persistenceConfigBuilder_ != null) { + persistenceConfigBuilder_.dispose(); + persistenceConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.PersistenceConfig.Builder getPersistenceConfigBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getPersistenceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.PersistenceConfigOrBuilder + getPersistenceConfigOrBuilder() { + if (persistenceConfigBuilder_ != null) { + return persistenceConfigBuilder_.getMessageOrBuilder(); + } else { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfigOrBuilder> + getPersistenceConfigFieldBuilder() { + if (persistenceConfigBuilder_ == null) { + persistenceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfigOrBuilder>( + getPersistenceConfig(), getParentForChildren(), isClean()); + persistenceConfig_ = null; + } + return persistenceConfigBuilder_; + } + + private java.lang.Object engineVersion_ = ""; + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The engineVersion. + */ + public java.lang.String getEngineVersion() { + java.lang.Object ref = engineVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + engineVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for engineVersion. + */ + public com.google.protobuf.ByteString getEngineVersionBytes() { + java.lang.Object ref = engineVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + engineVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The engineVersion to set. + * @return This builder for chaining. + */ + public Builder setEngineVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + engineVersion_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearEngineVersion() { + engineVersion_ = getDefaultInstance().getEngineVersion(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for engineVersion to set. + * @return This builder for chaining. + */ + public Builder setEngineVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + engineVersion_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField engineConfigs_; + + private com.google.protobuf.MapField + internalGetEngineConfigs() { + if (engineConfigs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EngineConfigsDefaultEntryHolder.defaultEntry); + } + return engineConfigs_; + } + + private com.google.protobuf.MapField + internalGetMutableEngineConfigs() { + if (engineConfigs_ == null) { + engineConfigs_ = + com.google.protobuf.MapField.newMapField(EngineConfigsDefaultEntryHolder.defaultEntry); + } + if (!engineConfigs_.isMutable()) { + engineConfigs_ = engineConfigs_.copy(); + } + bitField0_ |= 0x00008000; + onChanged(); + return engineConfigs_; + } + + public int getEngineConfigsCount() { + return internalGetEngineConfigs().getMap().size(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsEngineConfigs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEngineConfigs().getMap().containsKey(key); + } + /** Use {@link #getEngineConfigsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEngineConfigs() { + return getEngineConfigsMap(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getEngineConfigsMap() { + return internalGetEngineConfigs().getMap(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getEngineConfigsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getEngineConfigsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEngineConfigs() { + bitField0_ = (bitField0_ & ~0x00008000); + internalGetMutableEngineConfigs().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeEngineConfigs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEngineConfigs().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEngineConfigs() { + bitField0_ |= 0x00008000; + return internalGetMutableEngineConfigs().getMutableMap(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putEngineConfigs(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableEngineConfigs().getMutableMap().put(key, value); + bitField0_ |= 0x00008000; + return this; + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllEngineConfigs(java.util.Map values) { + internalGetMutableEngineConfigs().getMutableMap().putAll(values); + bitField0_ |= 0x00008000; + return this; + } + + private com.google.cloud.memorystore.v1.NodeConfig nodeConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.NodeConfig, + com.google.cloud.memorystore.v1.NodeConfig.Builder, + com.google.cloud.memorystore.v1.NodeConfigOrBuilder> + nodeConfigBuilder_; + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nodeConfig field is set. + */ + public boolean hasNodeConfig() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nodeConfig. + */ + public com.google.cloud.memorystore.v1.NodeConfig getNodeConfig() { + if (nodeConfigBuilder_ == null) { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1.NodeConfig.getDefaultInstance() + : nodeConfig_; + } else { + return nodeConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodeConfig(com.google.cloud.memorystore.v1.NodeConfig value) { + if (nodeConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nodeConfig_ = value; + } else { + nodeConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodeConfig( + com.google.cloud.memorystore.v1.NodeConfig.Builder builderForValue) { + if (nodeConfigBuilder_ == null) { + nodeConfig_ = builderForValue.build(); + } else { + nodeConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeNodeConfig(com.google.cloud.memorystore.v1.NodeConfig value) { + if (nodeConfigBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && nodeConfig_ != null + && nodeConfig_ != com.google.cloud.memorystore.v1.NodeConfig.getDefaultInstance()) { + getNodeConfigBuilder().mergeFrom(value); + } else { + nodeConfig_ = value; + } + } else { + nodeConfigBuilder_.mergeFrom(value); + } + if (nodeConfig_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodeConfig() { + bitField0_ = (bitField0_ & ~0x00010000); + nodeConfig_ = null; + if (nodeConfigBuilder_ != null) { + nodeConfigBuilder_.dispose(); + nodeConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.NodeConfig.Builder getNodeConfigBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getNodeConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1.NodeConfigOrBuilder getNodeConfigOrBuilder() { + if (nodeConfigBuilder_ != null) { + return nodeConfigBuilder_.getMessageOrBuilder(); + } else { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1.NodeConfig.getDefaultInstance() + : nodeConfig_; + } + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.NodeConfig, + com.google.cloud.memorystore.v1.NodeConfig.Builder, + com.google.cloud.memorystore.v1.NodeConfigOrBuilder> + getNodeConfigFieldBuilder() { + if (nodeConfigBuilder_ == null) { + nodeConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.NodeConfig, + com.google.cloud.memorystore.v1.NodeConfig.Builder, + com.google.cloud.memorystore.v1.NodeConfigOrBuilder>( + getNodeConfig(), getParentForChildren(), isClean()); + nodeConfig_ = null; + } + return nodeConfigBuilder_; + } + + private com.google.cloud.memorystore.v1.ZoneDistributionConfig zoneDistributionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.ZoneDistributionConfig, + com.google.cloud.memorystore.v1.ZoneDistributionConfig.Builder, + com.google.cloud.memorystore.v1.ZoneDistributionConfigOrBuilder> + zoneDistributionConfigBuilder_; + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the zoneDistributionConfig field is set. + */ + public boolean hasZoneDistributionConfig() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The zoneDistributionConfig. + */ + public com.google.cloud.memorystore.v1.ZoneDistributionConfig getZoneDistributionConfig() { + if (zoneDistributionConfigBuilder_ == null) { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } else { + return zoneDistributionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setZoneDistributionConfig( + com.google.cloud.memorystore.v1.ZoneDistributionConfig value) { + if (zoneDistributionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + zoneDistributionConfig_ = value; + } else { + zoneDistributionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setZoneDistributionConfig( + com.google.cloud.memorystore.v1.ZoneDistributionConfig.Builder builderForValue) { + if (zoneDistributionConfigBuilder_ == null) { + zoneDistributionConfig_ = builderForValue.build(); + } else { + zoneDistributionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeZoneDistributionConfig( + com.google.cloud.memorystore.v1.ZoneDistributionConfig value) { + if (zoneDistributionConfigBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && zoneDistributionConfig_ != null + && zoneDistributionConfig_ + != com.google.cloud.memorystore.v1.ZoneDistributionConfig.getDefaultInstance()) { + getZoneDistributionConfigBuilder().mergeFrom(value); + } else { + zoneDistributionConfig_ = value; + } + } else { + zoneDistributionConfigBuilder_.mergeFrom(value); + } + if (zoneDistributionConfig_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearZoneDistributionConfig() { + bitField0_ = (bitField0_ & ~0x00020000); + zoneDistributionConfig_ = null; + if (zoneDistributionConfigBuilder_ != null) { + zoneDistributionConfigBuilder_.dispose(); + zoneDistributionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1.ZoneDistributionConfig.Builder + getZoneDistributionConfigBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getZoneDistributionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1.ZoneDistributionConfigOrBuilder + getZoneDistributionConfigOrBuilder() { + if (zoneDistributionConfigBuilder_ != null) { + return zoneDistributionConfigBuilder_.getMessageOrBuilder(); + } else { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.ZoneDistributionConfig, + com.google.cloud.memorystore.v1.ZoneDistributionConfig.Builder, + com.google.cloud.memorystore.v1.ZoneDistributionConfigOrBuilder> + getZoneDistributionConfigFieldBuilder() { + if (zoneDistributionConfigBuilder_ == null) { + zoneDistributionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.ZoneDistributionConfig, + com.google.cloud.memorystore.v1.ZoneDistributionConfig.Builder, + com.google.cloud.memorystore.v1.ZoneDistributionConfigOrBuilder>( + getZoneDistributionConfig(), getParentForChildren(), isClean()); + zoneDistributionConfig_ = null; + } + return zoneDistributionConfigBuilder_; + } + + private boolean deletionProtectionEnabled_; + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the deletionProtectionEnabled field is set. + */ + @java.lang.Override + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The deletionProtectionEnabled. + */ + @java.lang.Override + public boolean getDeletionProtectionEnabled() { + return deletionProtectionEnabled_; + } + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The deletionProtectionEnabled to set. + * @return This builder for chaining. + */ + public Builder setDeletionProtectionEnabled(boolean value) { + + deletionProtectionEnabled_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDeletionProtectionEnabled() { + bitField0_ = (bitField0_ & ~0x00040000); + deletionProtectionEnabled_ = false; + onChanged(); + return this; + } + + private java.util.List pscAutoConnections_ = + java.util.Collections.emptyList(); + + private void ensurePscAutoConnectionsIsMutable() { + if (!((bitField0_ & 0x00080000) != 0)) { + pscAutoConnections_ = + new java.util.ArrayList( + pscAutoConnections_); + bitField0_ |= 0x00080000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.PscAutoConnection, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder> + pscAutoConnectionsBuilder_; + + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getPscAutoConnectionsList() { + if (pscAutoConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } else { + return pscAutoConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public int getPscAutoConnectionsCount() { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.size(); + } else { + return pscAutoConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1.PscAutoConnection getPscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.memorystore.v1.PscAutoConnection value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.memorystore.v1.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections(com.google.cloud.memorystore.v1.PscAutoConnection value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.memorystore.v1.PscAutoConnection value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.memorystore.v1.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.memorystore.v1.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAllPscAutoConnections( + java.lang.Iterable values) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pscAutoConnections_); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearPscAutoConnections() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + } else { + pscAutoConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder removePscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.remove(index); + onChanged(); + } else { + pscAutoConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1.PscAutoConnection.Builder getPscAutoConnectionsBuilder( + int index) { + return getPscAutoConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getPscAutoConnectionsOrBuilderList() { + if (pscAutoConnectionsBuilder_ != null) { + return pscAutoConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1.PscAutoConnection.Builder + addPscAutoConnectionsBuilder() { + return getPscAutoConnectionsFieldBuilder() + .addBuilder(com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1.PscAutoConnection.Builder addPscAutoConnectionsBuilder( + int index) { + return getPscAutoConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getPscAutoConnectionsBuilderList() { + return getPscAutoConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.PscAutoConnection, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder> + getPscAutoConnectionsFieldBuilder() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.PscAutoConnection, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder>( + pscAutoConnections_, + ((bitField0_ & 0x00080000) != 0), + getParentForChildren(), + isClean()); + pscAutoConnections_ = null; + } + return pscAutoConnectionsBuilder_; + } + + private java.util.List endpoints_ = + java.util.Collections.emptyList(); + + private void ensureEndpointsIsMutable() { + if (!((bitField0_ & 0x00100000) != 0)) { + endpoints_ = + new java.util.ArrayList( + endpoints_); + bitField0_ |= 0x00100000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder, + com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder> + endpointsBuilder_; + + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getEndpointsList() { + if (endpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(endpoints_); + } else { + return endpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getEndpointsCount() { + if (endpointsBuilder_ == null) { + return endpoints_.size(); + } else { + return endpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint getEndpoints(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEndpoints( + int index, com.google.cloud.memorystore.v1.Instance.InstanceEndpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEndpoints( + int index, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints(com.google.cloud.memorystore.v1.Instance.InstanceEndpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + onChanged(); + } else { + endpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints( + int index, com.google.cloud.memorystore.v1.Instance.InstanceEndpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(index, value); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints( + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints( + int index, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllEndpoints( + java.lang.Iterable + values) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpoints_); + onChanged(); + } else { + endpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEndpoints() { + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00100000); + onChanged(); + } else { + endpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeEndpoints(int index) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.remove(index); + onChanged(); + } else { + endpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder getEndpointsBuilder( + int index) { + return getEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder getEndpointsOrBuilder( + int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder> + getEndpointsOrBuilderList() { + if (endpointsBuilder_ != null) { + return endpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endpoints_); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder addEndpointsBuilder() { + return getEndpointsFieldBuilder() + .addBuilder( + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder addEndpointsBuilder( + int index) { + return getEndpointsFieldBuilder() + .addBuilder( + index, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getEndpointsBuilderList() { + return getEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder, + com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder> + getEndpointsFieldBuilder() { + if (endpointsBuilder_ == null) { + endpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint, + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint.Builder, + com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder>( + endpoints_, ((bitField0_ & 0x00100000) != 0), getParentForChildren(), isClean()); + endpoints_ = null; + } + return endpointsBuilder_; + } + + private int mode_ = 0; + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance.Mode getMode() { + com.google.cloud.memorystore.v1.Instance.Mode result = + com.google.cloud.memorystore.v1.Instance.Mode.forNumber(mode_); + return result == null ? com.google.cloud.memorystore.v1.Instance.Mode.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.cloud.memorystore.v1.Instance.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00200000; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00200000); + mode_ = 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.memorystore.v1.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.Instance) + private static final com.google.cloud.memorystore.v1.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.Instance(); + } + + public static com.google.cloud.memorystore.v1.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/InstanceName.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/InstanceName.java new file mode 100644 index 000000000000..344fad6264d5 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/InstanceName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class InstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + location = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String location, String instance) { + return newBuilder().setProject(project).setLocation(location).setInstance(instance).build(); + } + + public static String format(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_INSTANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_INSTANCE.instantiate( + "project", project, "location", location, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** Builder for projects/{project}/locations/{location}/instances/{instance}. */ + public static class Builder { + private String project; + private String location; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.location = instanceName.location; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/InstanceOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/InstanceOrBuilder.java new file mode 100644 index 000000000000..30cd3d259374 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/InstanceOrBuilder.java @@ -0,0 +1,887 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.memorystore.v1.Instance.State getState(); + + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + boolean hasStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + com.google.cloud.memorystore.v1.Instance.StateInfo getStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1.Instance.StateInfoOrBuilder getStateInfoOrBuilder(); + + /** + * + * + *
+   * Output only. System assigned, unique identifier for the instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. System assigned, unique identifier for the instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Optional. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + boolean hasReplicaCount(); + /** + * + * + *
+   * Optional. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + int getReplicaCount(); + + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + int getAuthorizationModeValue(); + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The authorizationMode. + */ + com.google.cloud.memorystore.v1.Instance.AuthorizationMode getAuthorizationMode(); + + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + int getTransitEncryptionModeValue(); + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The transitEncryptionMode. + */ + com.google.cloud.memorystore.v1.Instance.TransitEncryptionMode getTransitEncryptionMode(); + + /** + * + * + *
+   * Optional. Number of shards for the instance.
+   * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The shardCount. + */ + int getShardCount(); + + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDiscoveryEndpointsList(); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1.DiscoveryEndpoint getDiscoveryEndpoints(int index); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDiscoveryEndpointsCount(); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDiscoveryEndpointsOrBuilderList(); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1.DiscoveryEndpointOrBuilder getDiscoveryEndpointsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeType. + */ + int getNodeTypeValue(); + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeType. + */ + com.google.cloud.memorystore.v1.Instance.NodeType getNodeType(); + + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the persistenceConfig field is set. + */ + boolean hasPersistenceConfig(); + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The persistenceConfig. + */ + com.google.cloud.memorystore.v1.PersistenceConfig getPersistenceConfig(); + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1.PersistenceConfigOrBuilder getPersistenceConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The engineVersion. + */ + java.lang.String getEngineVersion(); + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for engineVersion. + */ + com.google.protobuf.ByteString getEngineVersionBytes(); + + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getEngineConfigsCount(); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsEngineConfigs(java.lang.String key); + /** Use {@link #getEngineConfigsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEngineConfigs(); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getEngineConfigsMap(); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getEngineConfigsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getEngineConfigsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nodeConfig field is set. + */ + boolean hasNodeConfig(); + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nodeConfig. + */ + com.google.cloud.memorystore.v1.NodeConfig getNodeConfig(); + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1.NodeConfigOrBuilder getNodeConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the zoneDistributionConfig field is set. + */ + boolean hasZoneDistributionConfig(); + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The zoneDistributionConfig. + */ + com.google.cloud.memorystore.v1.ZoneDistributionConfig getZoneDistributionConfig(); + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.memorystore.v1.ZoneDistributionConfigOrBuilder + getZoneDistributionConfigOrBuilder(); + + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the deletionProtectionEnabled field is set. + */ + boolean hasDeletionProtectionEnabled(); + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The deletionProtectionEnabled. + */ + boolean getDeletionProtectionEnabled(); + + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List getPscAutoConnectionsList(); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.memorystore.v1.PscAutoConnection getPscAutoConnections(int index); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + int getPscAutoConnectionsCount(); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List + getPscAutoConnectionsOrBuilderList(); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder getPscAutoConnectionsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1.Instance.InstanceEndpoint getEndpoints(int index); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getEndpointsCount(); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getEndpointsOrBuilderList(); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1.Instance.InstanceEndpointOrBuilder getEndpointsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.memorystore.v1.Instance.Mode getMode(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesRequest.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesRequest.java new file mode 100644 index 000000000000..793ea53cd632 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesRequest.java @@ -0,0 +1,1296 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Request message for [ListInstances][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.ListInstancesRequest} + */ +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.ListInstancesRequest.class, + com.google.cloud.memorystore.v1.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.ListInstancesRequest other = + (com.google.cloud.memorystore.v1.ListInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1.ListInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [ListInstances][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.ListInstancesRequest) + com.google.cloud.memorystore.v1.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.ListInstancesRequest.class, + com.google.cloud.memorystore.v1.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.ListInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesRequest build() { + com.google.cloud.memorystore.v1.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesRequest buildPartial() { + com.google.cloud.memorystore.v1.ListInstancesRequest result = + new com.google.cloud.memorystore.v1.ListInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.ListInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1.ListInstancesRequest) { + return mergeFrom((com.google.cloud.memorystore.v1.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.ListInstancesRequest other) { + if (other == com.google.cloud.memorystore.v1.ListInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.ListInstancesRequest) + private static final com.google.cloud.memorystore.v1.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.ListInstancesRequest(); + } + + public static com.google.cloud.memorystore.v1.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..8985126d183e --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesResponse.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesResponse.java new file mode 100644 index 000000000000..de58f81bee73 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesResponse.java @@ -0,0 +1,1449 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Response message for [ListInstances][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.ListInstancesResponse} + */ +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.ListInstancesResponse.class, + com.google.cloud.memorystore.v1.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.ListInstancesResponse other = + (com.google.cloud.memorystore.v1.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.ListInstancesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [ListInstances][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.ListInstancesResponse) + com.google.cloud.memorystore.v1.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.ListInstancesResponse.class, + com.google.cloud.memorystore.v1.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.ListInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesResponse build() { + com.google.cloud.memorystore.v1.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesResponse buildPartial() { + com.google.cloud.memorystore.v1.ListInstancesResponse result = + new com.google.cloud.memorystore.v1.ListInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.memorystore.v1.ListInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.memorystore.v1.ListInstancesResponse 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.memorystore.v1.ListInstancesResponse) { + return mergeFrom((com.google.cloud.memorystore.v1.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.ListInstancesResponse other) { + if (other == com.google.cloud.memorystore.v1.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 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.memorystore.v1.Instance m = + input.readMessage( + com.google.cloud.memorystore.v1.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.memorystore.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.memorystore.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.memorystore.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.memorystore.v1.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.memorystore.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.memorystore.v1.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.memorystore.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.memorystore.v1.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + 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.memorystore.v1.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.ListInstancesResponse) + private static final com.google.cloud.memorystore.v1.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.ListInstancesResponse(); + } + + public static com.google.cloud.memorystore.v1.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesResponseOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..dbffe4e666b5 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ListInstancesResponseOrBuilder.java @@ -0,0 +1,166 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + com.google.cloud.memorystore.v1.Instance getInstances(int index); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1.Instance instances = 1; + */ + com.google.cloud.memorystore.v1.InstanceOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * 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-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/LocationName.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/LocationName.java new file mode 100644 index 000000000000..603430b92c71 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.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-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/NodeConfig.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/NodeConfig.java new file mode 100644 index 000000000000..f0f70ac6452d --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/NodeConfig.java @@ -0,0 +1,537 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Represents configuration for nodes of the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.NodeConfig} + */ +public final class NodeConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.NodeConfig) + NodeConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NodeConfig.newBuilder() to construct. + private NodeConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NodeConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NodeConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_NodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_NodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.NodeConfig.class, + com.google.cloud.memorystore.v1.NodeConfig.Builder.class); + } + + public static final int SIZE_GB_FIELD_NUMBER = 1; + private double sizeGb_ = 0D; + /** + * + * + *
+   * Output only. Memory size in GB of the node.
+   * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public double getSizeGb() { + return sizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (java.lang.Double.doubleToRawLongBits(sizeGb_) != 0) { + output.writeDouble(1, sizeGb_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(sizeGb_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, sizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.NodeConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.NodeConfig other = + (com.google.cloud.memorystore.v1.NodeConfig) obj; + + if (java.lang.Double.doubleToLongBits(getSizeGb()) + != java.lang.Double.doubleToLongBits(other.getSizeGb())) return false; + if (!getUnknownFields().equals(other.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) + SIZE_GB_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getSizeGb())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.NodeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1.NodeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 configuration for nodes of the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.NodeConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.NodeConfig) + com.google.cloud.memorystore.v1.NodeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_NodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_NodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.NodeConfig.class, + com.google.cloud.memorystore.v1.NodeConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.NodeConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sizeGb_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_NodeConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.NodeConfig getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.NodeConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.NodeConfig build() { + com.google.cloud.memorystore.v1.NodeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.NodeConfig buildPartial() { + com.google.cloud.memorystore.v1.NodeConfig result = + new com.google.cloud.memorystore.v1.NodeConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.NodeConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sizeGb_ = sizeGb_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1.NodeConfig) { + return mergeFrom((com.google.cloud.memorystore.v1.NodeConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.NodeConfig other) { + if (other == com.google.cloud.memorystore.v1.NodeConfig.getDefaultInstance()) return this; + if (other.getSizeGb() != 0D) { + setSizeGb(other.getSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + sizeGb_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 double sizeGb_; + /** + * + * + *
+     * Output only. Memory size in GB of the node.
+     * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public double getSizeGb() { + return sizeGb_; + } + /** + * + * + *
+     * Output only. Memory size in GB of the node.
+     * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeGb to set. + * @return This builder for chaining. + */ + public Builder setSizeGb(double value) { + + sizeGb_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Memory size in GB of the node.
+     * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeGb() { + bitField0_ = (bitField0_ & ~0x00000001); + sizeGb_ = 0D; + 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.memorystore.v1.NodeConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.NodeConfig) + private static final com.google.cloud.memorystore.v1.NodeConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.NodeConfig(); + } + + public static com.google.cloud.memorystore.v1.NodeConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.NodeConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/NodeConfigOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/NodeConfigOrBuilder.java new file mode 100644 index 000000000000..d1b71ec70623 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/NodeConfigOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface NodeConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.NodeConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Memory size in GB of the node.
+   * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + double getSizeGb(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/OperationMetadata.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/OperationMetadata.java new file mode 100644 index 000000000000..2b15500dce17 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/OperationMetadata.java @@ -0,0 +1,1848 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Represents the metadata of a long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.OperationMetadata.class, + com.google.cloud.memorystore.v1.OperationMetadata.Builder.class); + } + + private int bitField0_; + 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 ((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. + */ + @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 ((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. + */ + @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 been cancelled successfully
+   * 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + 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.memorystore.v1.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.OperationMetadata other = + (com.google.cloud.memorystore.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.memorystore.v1.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.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.memorystore.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.memorystore.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.memorystore.v1.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of a long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.OperationMetadata) + com.google.cloud.memorystore.v1.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.OperationMetadata.class, + com.google.cloud.memorystore.v1.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.OperationMetadata build() { + com.google.cloud.memorystore.v1.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.OperationMetadata buildPartial() { + com.google.cloud.memorystore.v1.OperationMetadata result = + new com.google.cloud.memorystore.v1.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.OperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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_; + } + 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.memorystore.v1.OperationMetadata) { + return mergeFrom((com.google.cloud.memorystore.v1.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.OperationMetadata other) { + if (other == com.google.cloud.memorystore.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); + } + if (createTime_ != null) { + 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); + } + if (endTime_ != null) { + 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 been cancelled successfully
+     * 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 been cancelled successfully
+     * 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 been cancelled successfully
+     * 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.memorystore.v1.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.OperationMetadata) + private static final com.google.cloud.memorystore.v1.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.OperationMetadata(); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/OperationMetadataOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..1fad143bb9f3 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/OperationMetadataOrBuilder.java @@ -0,0 +1,219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.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 been cancelled successfully
+   * 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-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PersistenceConfig.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PersistenceConfig.java new file mode 100644 index 000000000000..354f8a69549b --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PersistenceConfig.java @@ -0,0 +1,3472 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Represents persistence configuration for a instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PersistenceConfig} + */ +public final class PersistenceConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.PersistenceConfig) + PersistenceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PersistenceConfig.newBuilder() to construct. + private PersistenceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PersistenceConfig() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PersistenceConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PersistenceConfig.class, + com.google.cloud.memorystore.v1.PersistenceConfig.Builder.class); + } + + /** + * + * + *
+   * Possible persistence modes.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode} + */ + public enum PersistenceMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + PERSISTENCE_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Persistence is disabled, and any snapshot data is deleted.
+     * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+     * RDB based persistence is enabled.
+     * 
+ * + * RDB = 2; + */ + RDB(2), + /** + * + * + *
+     * AOF based persistence is enabled.
+     * 
+ * + * AOF = 3; + */ + AOF(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + public static final int PERSISTENCE_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Persistence is disabled, and any snapshot data is deleted.
+     * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+     * RDB based persistence is enabled.
+     * 
+ * + * RDB = 2; + */ + public static final int RDB_VALUE = 2; + /** + * + * + *
+     * AOF based persistence is enabled.
+     * 
+ * + * AOF = 3; + */ + public static final int AOF_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PersistenceMode 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 PersistenceMode forNumber(int value) { + switch (value) { + case 0: + return PERSISTENCE_MODE_UNSPECIFIED; + case 1: + return DISABLED; + case 2: + return RDB; + case 3: + return AOF; + 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 PersistenceMode findValueByNumber(int number) { + return PersistenceMode.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.memorystore.v1.PersistenceConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final PersistenceMode[] VALUES = values(); + + public static PersistenceMode 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 PersistenceMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode) + } + + public interface RDBConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.PersistenceConfig.RDBConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for rdbSnapshotPeriod. + */ + int getRdbSnapshotPeriodValue(); + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotPeriod. + */ + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod + getRdbSnapshotPeriod(); + + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbSnapshotStartTime field is set. + */ + boolean hasRdbSnapshotStartTime(); + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotStartTime. + */ + com.google.protobuf.Timestamp getRdbSnapshotStartTime(); + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getRdbSnapshotStartTimeOrBuilder(); + } + /** + * + * + *
+   * Configuration for RDB based persistence.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PersistenceConfig.RDBConfig} + */ + public static final class RDBConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.PersistenceConfig.RDBConfig) + RDBConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use RDBConfig.newBuilder() to construct. + private RDBConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RDBConfig() { + rdbSnapshotPeriod_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RDBConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.class, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.Builder.class); + } + + /** + * + * + *
+     * Possible snapshot periods.
+     * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod} + */ + public enum SnapshotPeriod implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not set.
+       * 
+ * + * SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + SNAPSHOT_PERIOD_UNSPECIFIED(0), + /** + * + * + *
+       * One hour.
+       * 
+ * + * ONE_HOUR = 1; + */ + ONE_HOUR(1), + /** + * + * + *
+       * Six hours.
+       * 
+ * + * SIX_HOURS = 2; + */ + SIX_HOURS(2), + /** + * + * + *
+       * Twelve hours.
+       * 
+ * + * TWELVE_HOURS = 3; + */ + TWELVE_HOURS(3), + /** + * + * + *
+       * Twenty four hours.
+       * 
+ * + * TWENTY_FOUR_HOURS = 4; + */ + TWENTY_FOUR_HOURS(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not set.
+       * 
+ * + * SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + public static final int SNAPSHOT_PERIOD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * One hour.
+       * 
+ * + * ONE_HOUR = 1; + */ + public static final int ONE_HOUR_VALUE = 1; + /** + * + * + *
+       * Six hours.
+       * 
+ * + * SIX_HOURS = 2; + */ + public static final int SIX_HOURS_VALUE = 2; + /** + * + * + *
+       * Twelve hours.
+       * 
+ * + * TWELVE_HOURS = 3; + */ + public static final int TWELVE_HOURS_VALUE = 3; + /** + * + * + *
+       * Twenty four hours.
+       * 
+ * + * TWENTY_FOUR_HOURS = 4; + */ + public static final int TWENTY_FOUR_HOURS_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 SnapshotPeriod 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 SnapshotPeriod forNumber(int value) { + switch (value) { + case 0: + return SNAPSHOT_PERIOD_UNSPECIFIED; + case 1: + return ONE_HOUR; + case 2: + return SIX_HOURS; + case 3: + return TWELVE_HOURS; + case 4: + return TWENTY_FOUR_HOURS; + 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 SnapshotPeriod findValueByNumber(int number) { + return SnapshotPeriod.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.memorystore.v1.PersistenceConfig.RDBConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SnapshotPeriod[] VALUES = values(); + + public static SnapshotPeriod 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 SnapshotPeriod(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod) + } + + private int bitField0_; + public static final int RDB_SNAPSHOT_PERIOD_FIELD_NUMBER = 1; + private int rdbSnapshotPeriod_ = 0; + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for rdbSnapshotPeriod. + */ + @java.lang.Override + public int getRdbSnapshotPeriodValue() { + return rdbSnapshotPeriod_; + } + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotPeriod. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod + getRdbSnapshotPeriod() { + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod result = + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod.forNumber( + rdbSnapshotPeriod_); + return result == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod.UNRECOGNIZED + : result; + } + + public static final int RDB_SNAPSHOT_START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp rdbSnapshotStartTime_; + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbSnapshotStartTime field is set. + */ + @java.lang.Override + public boolean hasRdbSnapshotStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRdbSnapshotStartTime() { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRdbSnapshotStartTimeOrBuilder() { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (rdbSnapshotPeriod_ + != com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod + .SNAPSHOT_PERIOD_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, rdbSnapshotPeriod_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRdbSnapshotStartTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rdbSnapshotPeriod_ + != com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod + .SNAPSHOT_PERIOD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, rdbSnapshotPeriod_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRdbSnapshotStartTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig other = + (com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig) obj; + + if (rdbSnapshotPeriod_ != other.rdbSnapshotPeriod_) return false; + if (hasRdbSnapshotStartTime() != other.hasRdbSnapshotStartTime()) return false; + if (hasRdbSnapshotStartTime()) { + if (!getRdbSnapshotStartTime().equals(other.getRdbSnapshotStartTime())) return false; + } + if (!getUnknownFields().equals(other.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) + RDB_SNAPSHOT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + rdbSnapshotPeriod_; + if (hasRdbSnapshotStartTime()) { + hash = (37 * hash) + RDB_SNAPSHOT_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRdbSnapshotStartTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for RDB based persistence.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PersistenceConfig.RDBConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.PersistenceConfig.RDBConfig) + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.class, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRdbSnapshotStartTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rdbSnapshotPeriod_ = 0; + rdbSnapshotStartTime_ = null; + if (rdbSnapshotStartTimeBuilder_ != null) { + rdbSnapshotStartTimeBuilder_.dispose(); + rdbSnapshotStartTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig build() { + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig buildPartial() { + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig result = + new com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rdbSnapshotPeriod_ = rdbSnapshotPeriod_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rdbSnapshotStartTime_ = + rdbSnapshotStartTimeBuilder_ == null + ? rdbSnapshotStartTime_ + : rdbSnapshotStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + 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.memorystore.v1.PersistenceConfig.RDBConfig) { + return mergeFrom((com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig other) { + if (other + == com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.getDefaultInstance()) + return this; + if (other.rdbSnapshotPeriod_ != 0) { + setRdbSnapshotPeriodValue(other.getRdbSnapshotPeriodValue()); + } + if (other.hasRdbSnapshotStartTime()) { + mergeRdbSnapshotStartTime(other.getRdbSnapshotStartTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + rdbSnapshotPeriod_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getRdbSnapshotStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int rdbSnapshotPeriod_ = 0; + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for rdbSnapshotPeriod. + */ + @java.lang.Override + public int getRdbSnapshotPeriodValue() { + return rdbSnapshotPeriod_; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for rdbSnapshotPeriod to set. + * @return This builder for chaining. + */ + public Builder setRdbSnapshotPeriodValue(int value) { + rdbSnapshotPeriod_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotPeriod. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod + getRdbSnapshotPeriod() { + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod result = + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod.forNumber( + rdbSnapshotPeriod_); + return result == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The rdbSnapshotPeriod to set. + * @return This builder for chaining. + */ + public Builder setRdbSnapshotPeriod( + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + rdbSnapshotPeriod_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRdbSnapshotPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + rdbSnapshotPeriod_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp rdbSnapshotStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + rdbSnapshotStartTimeBuilder_; + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbSnapshotStartTime field is set. + */ + public boolean hasRdbSnapshotStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotStartTime. + */ + public com.google.protobuf.Timestamp getRdbSnapshotStartTime() { + if (rdbSnapshotStartTimeBuilder_ == null) { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } else { + return rdbSnapshotStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbSnapshotStartTime(com.google.protobuf.Timestamp value) { + if (rdbSnapshotStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rdbSnapshotStartTime_ = value; + } else { + rdbSnapshotStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbSnapshotStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (rdbSnapshotStartTimeBuilder_ == null) { + rdbSnapshotStartTime_ = builderForValue.build(); + } else { + rdbSnapshotStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRdbSnapshotStartTime(com.google.protobuf.Timestamp value) { + if (rdbSnapshotStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && rdbSnapshotStartTime_ != null + && rdbSnapshotStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRdbSnapshotStartTimeBuilder().mergeFrom(value); + } else { + rdbSnapshotStartTime_ = value; + } + } else { + rdbSnapshotStartTimeBuilder_.mergeFrom(value); + } + if (rdbSnapshotStartTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRdbSnapshotStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + rdbSnapshotStartTime_ = null; + if (rdbSnapshotStartTimeBuilder_ != null) { + rdbSnapshotStartTimeBuilder_.dispose(); + rdbSnapshotStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getRdbSnapshotStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRdbSnapshotStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getRdbSnapshotStartTimeOrBuilder() { + if (rdbSnapshotStartTimeBuilder_ != null) { + return rdbSnapshotStartTimeBuilder_.getMessageOrBuilder(); + } else { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRdbSnapshotStartTimeFieldBuilder() { + if (rdbSnapshotStartTimeBuilder_ == null) { + rdbSnapshotStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRdbSnapshotStartTime(), getParentForChildren(), isClean()); + rdbSnapshotStartTime_ = null; + } + return rdbSnapshotStartTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1.PersistenceConfig.RDBConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.PersistenceConfig.RDBConfig) + private static final com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig(); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RDBConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AOFConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.PersistenceConfig.AOFConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for appendFsync. + */ + int getAppendFsyncValue(); + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The appendFsync. + */ + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync getAppendFsync(); + } + /** + * + * + *
+   * Configuration for AOF based persistence.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PersistenceConfig.AOFConfig} + */ + public static final class AOFConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.PersistenceConfig.AOFConfig) + AOFConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AOFConfig.newBuilder() to construct. + private AOFConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AOFConfig() { + appendFsync_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AOFConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.class, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.Builder.class); + } + + /** + * + * + *
+     * Possible fsync modes.
+     * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync} + */ + public enum AppendFsync implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not set. Default: EVERY_SEC
+       * 
+ * + * APPEND_FSYNC_UNSPECIFIED = 0; + */ + APPEND_FSYNC_UNSPECIFIED(0), + /** + * + * + *
+       * Never fsync. Normally Linux will flush data every 30 seconds with this
+       * configuration, but it's up to the kernel's exact tuning.
+       * 
+ * + * NEVER = 1; + */ + NEVER(1), + /** + * + * + *
+       * Fsync every second. You may lose 1 second of data if there is a
+       * disaster.
+       * 
+ * + * EVERY_SEC = 2; + */ + EVERY_SEC(2), + /** + * + * + *
+       * Fsync every time new write commands are appended to the AOF. The best
+       * data loss protection at the cost of performance.
+       * 
+ * + * ALWAYS = 3; + */ + ALWAYS(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not set. Default: EVERY_SEC
+       * 
+ * + * APPEND_FSYNC_UNSPECIFIED = 0; + */ + public static final int APPEND_FSYNC_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Never fsync. Normally Linux will flush data every 30 seconds with this
+       * configuration, but it's up to the kernel's exact tuning.
+       * 
+ * + * NEVER = 1; + */ + public static final int NEVER_VALUE = 1; + /** + * + * + *
+       * Fsync every second. You may lose 1 second of data if there is a
+       * disaster.
+       * 
+ * + * EVERY_SEC = 2; + */ + public static final int EVERY_SEC_VALUE = 2; + /** + * + * + *
+       * Fsync every time new write commands are appended to the AOF. The best
+       * data loss protection at the cost of performance.
+       * 
+ * + * ALWAYS = 3; + */ + public static final int ALWAYS_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AppendFsync 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 AppendFsync forNumber(int value) { + switch (value) { + case 0: + return APPEND_FSYNC_UNSPECIFIED; + case 1: + return NEVER; + case 2: + return EVERY_SEC; + case 3: + return ALWAYS; + 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 AppendFsync findValueByNumber(int number) { + return AppendFsync.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.memorystore.v1.PersistenceConfig.AOFConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AppendFsync[] VALUES = values(); + + public static AppendFsync 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 AppendFsync(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync) + } + + public static final int APPEND_FSYNC_FIELD_NUMBER = 1; + private int appendFsync_ = 0; + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for appendFsync. + */ + @java.lang.Override + public int getAppendFsyncValue() { + return appendFsync_; + } + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The appendFsync. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync + getAppendFsync() { + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync result = + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync.forNumber( + appendFsync_); + return result == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (appendFsync_ + != com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync + .APPEND_FSYNC_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, appendFsync_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (appendFsync_ + != com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync + .APPEND_FSYNC_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, appendFsync_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig other = + (com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig) obj; + + if (appendFsync_ != other.appendFsync_) return false; + if (!getUnknownFields().equals(other.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) + APPEND_FSYNC_FIELD_NUMBER; + hash = (53 * hash) + appendFsync_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for AOF based persistence.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PersistenceConfig.AOFConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.PersistenceConfig.AOFConfig) + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.class, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + appendFsync_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig build() { + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig buildPartial() { + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig result = + new com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.appendFsync_ = appendFsync_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig) { + return mergeFrom((com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig other) { + if (other + == com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.getDefaultInstance()) + return this; + if (other.appendFsync_ != 0) { + setAppendFsyncValue(other.getAppendFsyncValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + appendFsync_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int appendFsync_ = 0; + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for appendFsync. + */ + @java.lang.Override + public int getAppendFsyncValue() { + return appendFsync_; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for appendFsync to set. + * @return This builder for chaining. + */ + public Builder setAppendFsyncValue(int value) { + appendFsync_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The appendFsync. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync + getAppendFsync() { + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync result = + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync.forNumber( + appendFsync_); + return result == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync.UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The appendFsync to set. + * @return This builder for chaining. + */ + public Builder setAppendFsync( + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + appendFsync_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAppendFsync() { + bitField0_ = (bitField0_ & ~0x00000001); + appendFsync_ = 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.memorystore.v1.PersistenceConfig.AOFConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.PersistenceConfig.AOFConfig) + private static final com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig(); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AOFConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode getMode() { + com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode result = + com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode.forNumber(mode_); + return result == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode.UNRECOGNIZED + : result; + } + + public static final int RDB_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdbConfig_; + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbConfig field is set. + */ + @java.lang.Override + public boolean hasRdbConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig getRdbConfig() { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigOrBuilder + getRdbConfigOrBuilder() { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } + + public static final int AOF_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aofConfig_; + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the aofConfig field is set. + */ + @java.lang.Override + public boolean hasAofConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The aofConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig getAofConfig() { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigOrBuilder + getAofConfigOrBuilder() { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (mode_ + != com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode + .PERSISTENCE_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRdbConfig()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getAofConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode + .PERSISTENCE_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRdbConfig()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAofConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.PersistenceConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.PersistenceConfig other = + (com.google.cloud.memorystore.v1.PersistenceConfig) obj; + + if (mode_ != other.mode_) return false; + if (hasRdbConfig() != other.hasRdbConfig()) return false; + if (hasRdbConfig()) { + if (!getRdbConfig().equals(other.getRdbConfig())) return false; + } + if (hasAofConfig() != other.hasAofConfig()) return false; + if (hasAofConfig()) { + if (!getAofConfig().equals(other.getAofConfig())) return false; + } + if (!getUnknownFields().equals(other.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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + if (hasRdbConfig()) { + hash = (37 * hash) + RDB_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getRdbConfig().hashCode(); + } + if (hasAofConfig()) { + hash = (37 * hash) + AOF_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAofConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1.PersistenceConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 persistence configuration for a instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PersistenceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.PersistenceConfig) + com.google.cloud.memorystore.v1.PersistenceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PersistenceConfig.class, + com.google.cloud.memorystore.v1.PersistenceConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.PersistenceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRdbConfigFieldBuilder(); + getAofConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mode_ = 0; + rdbConfig_ = null; + if (rdbConfigBuilder_ != null) { + rdbConfigBuilder_.dispose(); + rdbConfigBuilder_ = null; + } + aofConfig_ = null; + if (aofConfigBuilder_ != null) { + aofConfigBuilder_.dispose(); + aofConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.PersistenceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig build() { + com.google.cloud.memorystore.v1.PersistenceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig buildPartial() { + com.google.cloud.memorystore.v1.PersistenceConfig result = + new com.google.cloud.memorystore.v1.PersistenceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.PersistenceConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mode_ = mode_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rdbConfig_ = rdbConfigBuilder_ == null ? rdbConfig_ : rdbConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.aofConfig_ = aofConfigBuilder_ == null ? aofConfig_ : aofConfigBuilder_.build(); + 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.memorystore.v1.PersistenceConfig) { + return mergeFrom((com.google.cloud.memorystore.v1.PersistenceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.PersistenceConfig other) { + if (other == com.google.cloud.memorystore.v1.PersistenceConfig.getDefaultInstance()) + return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + if (other.hasRdbConfig()) { + mergeRdbConfig(other.getRdbConfig()); + } + if (other.hasAofConfig()) { + mergeAofConfig(other.getAofConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getRdbConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getAofConfigFieldBuilder().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 int mode_ = 0; + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode getMode() { + com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode result = + com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode.forNumber(mode_); + return result == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000001); + mode_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdbConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigOrBuilder> + rdbConfigBuilder_; + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbConfig field is set. + */ + public boolean hasRdbConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbConfig. + */ + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig getRdbConfig() { + if (rdbConfigBuilder_ == null) { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } else { + return rdbConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbConfig(com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig value) { + if (rdbConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rdbConfig_ = value; + } else { + rdbConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbConfig( + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.Builder builderForValue) { + if (rdbConfigBuilder_ == null) { + rdbConfig_ = builderForValue.build(); + } else { + rdbConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRdbConfig( + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig value) { + if (rdbConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && rdbConfig_ != null + && rdbConfig_ + != com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig + .getDefaultInstance()) { + getRdbConfigBuilder().mergeFrom(value); + } else { + rdbConfig_ = value; + } + } else { + rdbConfigBuilder_.mergeFrom(value); + } + if (rdbConfig_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRdbConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + rdbConfig_ = null; + if (rdbConfigBuilder_ != null) { + rdbConfigBuilder_.dispose(); + rdbConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.Builder + getRdbConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRdbConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigOrBuilder + getRdbConfigOrBuilder() { + if (rdbConfigBuilder_ != null) { + return rdbConfigBuilder_.getMessageOrBuilder(); + } else { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigOrBuilder> + getRdbConfigFieldBuilder() { + if (rdbConfigBuilder_ == null) { + rdbConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigOrBuilder>( + getRdbConfig(), getParentForChildren(), isClean()); + rdbConfig_ = null; + } + return rdbConfigBuilder_; + } + + private com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aofConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigOrBuilder> + aofConfigBuilder_; + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the aofConfig field is set. + */ + public boolean hasAofConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The aofConfig. + */ + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig getAofConfig() { + if (aofConfigBuilder_ == null) { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } else { + return aofConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAofConfig(com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig value) { + if (aofConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aofConfig_ = value; + } else { + aofConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAofConfig( + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.Builder builderForValue) { + if (aofConfigBuilder_ == null) { + aofConfig_ = builderForValue.build(); + } else { + aofConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeAofConfig( + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig value) { + if (aofConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && aofConfig_ != null + && aofConfig_ + != com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig + .getDefaultInstance()) { + getAofConfigBuilder().mergeFrom(value); + } else { + aofConfig_ = value; + } + } else { + aofConfigBuilder_.mergeFrom(value); + } + if (aofConfig_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearAofConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + aofConfig_ = null; + if (aofConfigBuilder_ != null) { + aofConfigBuilder_.dispose(); + aofConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.Builder + getAofConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAofConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigOrBuilder + getAofConfigOrBuilder() { + if (aofConfigBuilder_ != null) { + return aofConfigBuilder_.getMessageOrBuilder(); + } else { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigOrBuilder> + getAofConfigFieldBuilder() { + if (aofConfigBuilder_ == null) { + aofConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig.Builder, + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigOrBuilder>( + getAofConfig(), getParentForChildren(), isClean()); + aofConfig_ = null; + } + return aofConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1.PersistenceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.PersistenceConfig) + private static final com.google.cloud.memorystore.v1.PersistenceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.PersistenceConfig(); + } + + public static com.google.cloud.memorystore.v1.PersistenceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PersistenceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PersistenceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PersistenceConfigOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PersistenceConfigOrBuilder.java new file mode 100644 index 000000000000..940825836c46 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PersistenceConfigOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface PersistenceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.PersistenceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.memorystore.v1.PersistenceConfig.PersistenceMode getMode(); + + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbConfig field is set. + */ + boolean hasRdbConfig(); + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbConfig. + */ + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfig getRdbConfig(); + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1.PersistenceConfig.RDBConfigOrBuilder getRdbConfigOrBuilder(); + + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the aofConfig field is set. + */ + boolean hasAofConfig(); + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The aofConfig. + */ + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfig getAofConfig(); + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1.PersistenceConfig.AOFConfigOrBuilder getAofConfigOrBuilder(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscAutoConnection.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscAutoConnection.java new file mode 100644 index 000000000000..1b88d6e16be2 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscAutoConnection.java @@ -0,0 +1,2235 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Details of consumer resources in a PSC connection.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PscAutoConnection} + */ +public final class PscAutoConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.PscAutoConnection) + PscAutoConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PscAutoConnection.newBuilder() to construct. + private PscAutoConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PscAutoConnection() { + pscConnectionId_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PscAutoConnection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscAutoConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscAutoConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PscAutoConnection.class, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder.class); + } + + private int portsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object ports_; + + public enum PortsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PORT(9), + PORTS_NOT_SET(0); + private final int value; + + private PortsCase(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 PortsCase valueOf(int value) { + return forNumber(value); + } + + public static PortsCase forNumber(int value) { + switch (value) { + case 9: + return PORT; + case 0: + return PORTS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PortsCase getPortsCase() { + return PortsCase.forNumber(portsCase_); + } + + public static final int PORT_FIELD_NUMBER = 9; + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the port field is set. + */ + @java.lang.Override + public boolean hasPort() { + return portsCase_ == 9; + } + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + if (portsCase_ == 9) { + return (java.lang.Integer) ports_; + } + return 0; + } + + 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 IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORWARDING_RULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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_ = ""; + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ = ""; + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ATTACHMENT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + @java.lang.Override + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_CONNECTION_STATUS_FIELD_NUMBER = 7; + private int pscConnectionStatus_ = 0; + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1.PscConnectionStatus result = + com.google.cloud.memorystore.v1.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1.PscConnectionStatus.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_TYPE_FIELD_NUMBER = 8; + private int connectionType_ = 0; + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1.ConnectionType result = + com.google.cloud.memorystore.v1.ConnectionType.forNumber(connectionType_); + return result == null ? com.google.cloud.memorystore.v1.ConnectionType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pscConnectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1.ConnectionType.CONNECTION_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, connectionType_); + } + if (portsCase_ == 9) { + output.writeInt32(9, (int) ((java.lang.Integer) ports_)); + } + 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(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1.ConnectionType.CONNECTION_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, connectionType_); + } + if (portsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 9, (int) ((java.lang.Integer) ports_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.PscAutoConnection)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.PscAutoConnection other = + (com.google.cloud.memorystore.v1.PscAutoConnection) obj; + + if (!getPscConnectionId().equals(other.getPscConnectionId())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getForwardingRule().equals(other.getForwardingRule())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getServiceAttachment().equals(other.getServiceAttachment())) return false; + if (pscConnectionStatus_ != other.pscConnectionStatus_) return false; + if (connectionType_ != other.connectionType_) return false; + if (!getPortsCase().equals(other.getPortsCase())) return false; + switch (portsCase_) { + case 9: + if (getPort() != other.getPort()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PSC_CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPscConnectionId().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().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 = (37 * hash) + SERVICE_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAttachment().hashCode(); + hash = (37 * hash) + PSC_CONNECTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + pscConnectionStatus_; + hash = (37 * hash) + CONNECTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + connectionType_; + switch (portsCase_) { + case 9: + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1.PscAutoConnection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.memorystore.v1.PscAutoConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.PscAutoConnection) + com.google.cloud.memorystore.v1.PscAutoConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscAutoConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscAutoConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PscAutoConnection.class, + com.google.cloud.memorystore.v1.PscAutoConnection.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.PscAutoConnection.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pscConnectionId_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + portsCase_ = 0; + ports_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscAutoConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnection getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnection build() { + com.google.cloud.memorystore.v1.PscAutoConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnection buildPartial() { + com.google.cloud.memorystore.v1.PscAutoConnection result = + new com.google.cloud.memorystore.v1.PscAutoConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.PscAutoConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pscConnectionId_ = pscConnectionId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.forwardingRule_ = forwardingRule_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.serviceAttachment_ = serviceAttachment_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pscConnectionStatus_ = pscConnectionStatus_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.connectionType_ = connectionType_; + } + } + + private void buildPartialOneofs(com.google.cloud.memorystore.v1.PscAutoConnection result) { + result.portsCase_ = portsCase_; + result.ports_ = this.ports_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1.PscAutoConnection) { + return mergeFrom((com.google.cloud.memorystore.v1.PscAutoConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.PscAutoConnection other) { + if (other == com.google.cloud.memorystore.v1.PscAutoConnection.getDefaultInstance()) + return this; + if (!other.getPscConnectionId().isEmpty()) { + pscConnectionId_ = other.pscConnectionId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getForwardingRule().isEmpty()) { + forwardingRule_ = other.forwardingRule_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getServiceAttachment().isEmpty()) { + serviceAttachment_ = other.serviceAttachment_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.pscConnectionStatus_ != 0) { + setPscConnectionStatusValue(other.getPscConnectionStatusValue()); + } + if (other.connectionType_ != 0) { + setConnectionTypeValue(other.getConnectionTypeValue()); + } + switch (other.getPortsCase()) { + case PORT: + { + setPort(other.getPort()); + break; + } + case PORTS_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: + { + pscConnectionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + forwardingRule_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + projectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + serviceAttachment_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 56: + { + pscConnectionStatus_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: + { + connectionType_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 72: + { + ports_ = input.readInt32(); + portsCase_ = 9; + break; + } // case 72 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 portsCase_ = 0; + private java.lang.Object ports_; + + public PortsCase getPortsCase() { + return PortsCase.forNumber(portsCase_); + } + + public Builder clearPorts() { + portsCase_ = 0; + ports_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the port field is set. + */ + public boolean hasPort() { + return portsCase_ == 9; + } + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The port. + */ + public int getPort() { + if (portsCase_ == 9) { + return (java.lang.Integer) ports_; + } + return 0; + } + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + portsCase_ = 9; + ports_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPort() { + if (portsCase_ == 9) { + portsCase_ = 0; + ports_ = null; + onChanged(); + } + return this; + } + + 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_ |= 0x00000002; + 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_ & ~0x00000002); + 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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearForwardingRule() { + forwardingRule_ = getDefaultInstance().getForwardingRule(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + projectId_ = getDefaultInstance().getProjectId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAttachment_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServiceAttachment() { + serviceAttachment_ = getDefaultInstance().getServiceAttachment(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAttachment_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private int pscConnectionStatus_ = 0; + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatusValue(int value) { + pscConnectionStatus_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1.PscConnectionStatus result = + com.google.cloud.memorystore.v1.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1.PscConnectionStatus.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatus( + com.google.cloud.memorystore.v1.PscConnectionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + pscConnectionStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscConnectionStatus() { + bitField0_ = (bitField0_ & ~0x00000080); + pscConnectionStatus_ = 0; + onChanged(); + return this; + } + + private int connectionType_ = 0; + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionTypeValue(int value) { + connectionType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1.ConnectionType result = + com.google.cloud.memorystore.v1.ConnectionType.forNumber(connectionType_); + return result == null ? com.google.cloud.memorystore.v1.ConnectionType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionType(com.google.cloud.memorystore.v1.ConnectionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + connectionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionType() { + bitField0_ = (bitField0_ & ~0x00000100); + connectionType_ = 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.memorystore.v1.PscAutoConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.PscAutoConnection) + private static final com.google.cloud.memorystore.v1.PscAutoConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.PscAutoConnection(); + } + + public static com.google.cloud.memorystore.v1.PscAutoConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscAutoConnection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PscAutoConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscAutoConnectionOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscAutoConnectionOrBuilder.java new file mode 100644 index 000000000000..978930c1ab18 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscAutoConnectionOrBuilder.java @@ -0,0 +1,305 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface PscAutoConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.PscAutoConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the port field is set. + */ + boolean hasPort(); + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The port. + */ + int getPort(); + + /** + * + * + *
+   * 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 ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The forwardingRule. + */ + java.lang.String getForwardingRule(); + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for forwardingRule. + */ + com.google.protobuf.ByteString getForwardingRuleBytes(); + + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + java.lang.String getServiceAttachment(); + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + com.google.protobuf.ByteString getServiceAttachmentBytes(); + + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + int getPscConnectionStatusValue(); + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + com.google.cloud.memorystore.v1.PscConnectionStatus getPscConnectionStatus(); + + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + int getConnectionTypeValue(); + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + com.google.cloud.memorystore.v1.ConnectionType getConnectionType(); + + com.google.cloud.memorystore.v1.PscAutoConnection.PortsCase getPortsCase(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnection.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnection.java new file mode 100644 index 000000000000..b1e735a36d9d --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnection.java @@ -0,0 +1,2002 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * User created Psc connection configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PscConnection} + */ +public final class PscConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.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_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + } + + @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.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PscConnection.class, + com.google.cloud.memorystore.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 IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORWARDING_RULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_ = ""; + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ATTACHMENT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + @java.lang.Override + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_CONNECTION_STATUS_FIELD_NUMBER = 7; + private int pscConnectionStatus_ = 0; + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1.PscConnectionStatus result = + com.google.cloud.memorystore.v1.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1.PscConnectionStatus.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_TYPE_FIELD_NUMBER = 8; + private int connectionType_ = 0; + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1.ConnectionType result = + com.google.cloud.memorystore.v1.ConnectionType.forNumber(connectionType_); + return result == null ? com.google.cloud.memorystore.v1.ConnectionType.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pscConnectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1.ConnectionType.CONNECTION_TYPE_UNSPECIFIED.getNumber()) { + output.writeEnum(8, connectionType_); + } + 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(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1.ConnectionType.CONNECTION_TYPE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, connectionType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.PscConnection)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.PscConnection other = + (com.google.cloud.memorystore.v1.PscConnection) obj; + + if (!getPscConnectionId().equals(other.getPscConnectionId())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getForwardingRule().equals(other.getForwardingRule())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getServiceAttachment().equals(other.getServiceAttachment())) return false; + if (pscConnectionStatus_ != other.pscConnectionStatus_) return false; + if (connectionType_ != other.connectionType_) return false; + if (!getUnknownFields().equals(other.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) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().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 = (37 * hash) + SERVICE_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAttachment().hashCode(); + hash = (37 * hash) + PSC_CONNECTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + pscConnectionStatus_; + hash = (37 * hash) + CONNECTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + connectionType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.PscConnection parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.PscConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.PscConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.PscConnection parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.PscConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.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.memorystore.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.memorystore.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.memorystore.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; + } + /** + * + * + *
+   * User created Psc connection configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.PscConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.PscConnection) + com.google.cloud.memorystore.v1.PscConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.PscConnection.class, + com.google.cloud.memorystore.v1.PscConnection.Builder.class); + } + + // Construct using com.google.cloud.memorystore.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_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_PscConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnection getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnection build() { + com.google.cloud.memorystore.v1.PscConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnection buildPartial() { + com.google.cloud.memorystore.v1.PscConnection result = + new com.google.cloud.memorystore.v1.PscConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.PscConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pscConnectionId_ = pscConnectionId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.forwardingRule_ = forwardingRule_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.serviceAttachment_ = serviceAttachment_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscConnectionStatus_ = pscConnectionStatus_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.connectionType_ = connectionType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1.PscConnection) { + return mergeFrom((com.google.cloud.memorystore.v1.PscConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.PscConnection other) { + if (other == com.google.cloud.memorystore.v1.PscConnection.getDefaultInstance()) return this; + if (!other.getPscConnectionId().isEmpty()) { + pscConnectionId_ = other.pscConnectionId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + 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(); + } + if (!other.getServiceAttachment().isEmpty()) { + serviceAttachment_ = other.serviceAttachment_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.pscConnectionStatus_ != 0) { + setPscConnectionStatusValue(other.getPscConnectionStatusValue()); + } + if (other.connectionType_ != 0) { + setConnectionTypeValue(other.getConnectionTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + ipAddress_ = 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 + case 50: + { + serviceAttachment_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + pscConnectionStatus_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + connectionType_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 ipAddress_ = ""; + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearForwardingRule() { + forwardingRule_ = getDefaultInstance().getForwardingRule(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_ = ""; + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAttachment_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServiceAttachment() { + serviceAttachment_ = getDefaultInstance().getServiceAttachment(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAttachment_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int pscConnectionStatus_ = 0; + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatusValue(int value) { + pscConnectionStatus_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1.PscConnectionStatus result = + com.google.cloud.memorystore.v1.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1.PscConnectionStatus.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatus( + com.google.cloud.memorystore.v1.PscConnectionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + pscConnectionStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscConnectionStatus() { + bitField0_ = (bitField0_ & ~0x00000040); + pscConnectionStatus_ = 0; + onChanged(); + return this; + } + + private int connectionType_ = 0; + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionTypeValue(int value) { + connectionType_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1.ConnectionType result = + com.google.cloud.memorystore.v1.ConnectionType.forNumber(connectionType_); + return result == null ? com.google.cloud.memorystore.v1.ConnectionType.UNRECOGNIZED : result; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionType(com.google.cloud.memorystore.v1.ConnectionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + connectionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionType() { + bitField0_ = (bitField0_ & ~0x00000080); + connectionType_ = 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.memorystore.v1.PscConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.PscConnection) + private static final com.google.cloud.memorystore.v1.PscConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.PscConnection(); + } + + public static com.google.cloud.memorystore.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.memorystore.v1.PscConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnectionOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnectionOrBuilder.java new file mode 100644 index 000000000000..534bff57f7d4 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnectionOrBuilder.java @@ -0,0 +1,272 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface PscConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.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(); + + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The forwardingRule. + */ + java.lang.String getForwardingRule(); + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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(); + + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + java.lang.String getServiceAttachment(); + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + com.google.protobuf.ByteString getServiceAttachmentBytes(); + + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + int getPscConnectionStatusValue(); + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + com.google.cloud.memorystore.v1.PscConnectionStatus getPscConnectionStatus(); + + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + int getConnectionTypeValue(); + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + com.google.cloud.memorystore.v1.ConnectionType getConnectionType(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnectionStatus.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnectionStatus.java new file mode 100644 index 000000000000..cb266fdb11b6 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/PscConnectionStatus.java @@ -0,0 +1,180 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Status of the PSC connection.
+ * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.PscConnectionStatus} + */ +public enum PscConnectionStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * PSC connection status is not specified.
+   * 
+ * + * PSC_CONNECTION_STATUS_UNSPECIFIED = 0; + */ + PSC_CONNECTION_STATUS_UNSPECIFIED(0), + /** + * + * + *
+   * The connection is active
+   * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+   * Connection not found
+   * 
+ * + * NOT_FOUND = 2; + */ + NOT_FOUND(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * PSC connection status is not specified.
+   * 
+ * + * PSC_CONNECTION_STATUS_UNSPECIFIED = 0; + */ + public static final int PSC_CONNECTION_STATUS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The connection is active
+   * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+   * Connection not found
+   * 
+ * + * NOT_FOUND = 2; + */ + public static final int NOT_FOUND_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 PscConnectionStatus 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 PscConnectionStatus forNumber(int value) { + switch (value) { + case 0: + return PSC_CONNECTION_STATUS_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return NOT_FOUND; + 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 PscConnectionStatus findValueByNumber(int number) { + return PscConnectionStatus.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.memorystore.v1.V1mainProto.getDescriptor().getEnumTypes().get(0); + } + + private static final PscConnectionStatus[] VALUES = values(); + + public static PscConnectionStatus 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 PscConnectionStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.PscConnectionStatus) +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/UpdateInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/UpdateInstanceRequest.java new file mode 100644 index 000000000000..58b094b50810 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/UpdateInstanceRequest.java @@ -0,0 +1,1315 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Request message for [UpdateInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInstanceRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.UpdateInstanceRequest.class, + com.google.cloud.memorystore.v1.UpdateInstanceRequest.Builder.class); + } + + private int bitField0_; + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.memorystore.v1.Instance instance_; + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.Instance getInstance() { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getInstance()); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + 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.memorystore.v1.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.UpdateInstanceRequest other = + (com.google.cloud.memorystore.v1.UpdateInstanceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.UpdateInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [UpdateInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.UpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.UpdateInstanceRequest) + com.google.cloud.memorystore.v1.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.UpdateInstanceRequest.class, + com.google.cloud.memorystore.v1.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.UpdateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateMaskFieldBuilder(); + getInstanceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.UpdateInstanceRequest build() { + com.google.cloud.memorystore.v1.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.UpdateInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1.UpdateInstanceRequest result = + new com.google.cloud.memorystore.v1.UpdateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.UpdateInstanceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + 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.memorystore.v1.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1.UpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.UpdateInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1.UpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.memorystore.v1.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.memorystore.v1.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.memorystore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.memorystore.v1.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.memorystore.v1.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && instance_ != null + && instance_ != com.google.cloud.memorystore.v1.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + if (instance_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000002); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.memorystore.v1.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1.Instance, + com.google.cloud.memorystore.v1.Instance.Builder, + com.google.cloud.memorystore.v1.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.UpdateInstanceRequest) + private static final com.google.cloud.memorystore.v1.UpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.UpdateInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/UpdateInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..a31c8fcf29d4 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface UpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.memorystore.v1.Instance getInstance(); + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.memorystore.v1.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/V1mainProto.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/V1mainProto.java new file mode 100644 index 000000000000..d8249174fbcc --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/V1mainProto.java @@ -0,0 +1,676 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public final class V1mainProto { + private V1mainProto() {} + + 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_memorystore_v1_Instance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_Instance_EngineConfigsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_Instance_EngineConfigsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_PscAutoConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_PscAutoConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_PscConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_PscConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_PersistenceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_NodeConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_NodeConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_CertificateAuthority_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_CertificateAuthority_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n-google/cloud/memorystore/v1/memorystor" + + "e.proto\022\033google.cloud.memorystore.v1\032\034go" + + "ogle/api/annotations.proto\032\027google/api/c" + + "lient.proto\032\037google/api/field_behavior.p" + + "roto\032\033google/api/field_info.proto\032\031googl" + + "e/api/resource.proto\032#google/longrunning" + + "/operations.proto\032\033google/protobuf/empty" + + ".proto\032 google/protobuf/field_mask.proto" + + "\032\037google/protobuf/timestamp.proto\"\236\025\n\010In" + + "stance\022\021\n\004name\030\001 \001(\tB\003\340A\010\0224\n\013create_time" + + "\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\003\022" + + "4\n\013update_time\030\003 \001(\0132\032.google.protobuf.T" + + "imestampB\003\340A\003\022F\n\006labels\030\004 \003(\01321.google.c" + + "loud.memorystore.v1.Instance.LabelsEntry" + + "B\003\340A\001\022?\n\005state\030\005 \001(\0162+.google.cloud.memo" + + "rystore.v1.Instance.StateB\003\340A\003\022H\n\nstate_" + + "info\030\006 \001(\0132/.google.cloud.memorystore.v1" + + ".Instance.StateInfoB\003\340A\003\022\030\n\003uid\030\007 \001(\tB\013\340" + + "A\003\342\214\317\327\010\002\010\001\022\037\n\rreplica_count\030\010 \001(\005B\003\340A\001H\000" + + "\210\001\001\022[\n\022authorization_mode\030\t \001(\01627.google" + + ".cloud.memorystore.v1.Instance.Authoriza" + + "tionModeB\006\340A\001\340A\005\022d\n\027transit_encryption_m" + + "ode\030\n \001(\0162;.google.cloud.memorystore.v1." + + "Instance.TransitEncryptionModeB\006\340A\001\340A\005\022\030" + + "\n\013shard_count\030\013 \001(\005B\003\340A\001\022P\n\023discovery_en" + + "dpoints\030\014 \003(\0132..google.cloud.memorystore" + + ".v1.DiscoveryEndpointB\003\340A\003\022I\n\tnode_type\030" + + "\r \001(\0162..google.cloud.memorystore.v1.Inst" + + "ance.NodeTypeB\006\340A\001\340A\005\022O\n\022persistence_con" + + "fig\030\016 \001(\0132..google.cloud.memorystore.v1." + + "PersistenceConfigB\003\340A\001\022\036\n\016engine_version" + + "\030\017 \001(\tB\006\340A\001\340A\005\022U\n\016engine_configs\030\020 \003(\01328" + + ".google.cloud.memorystore.v1.Instance.En" + + "gineConfigsEntryB\003\340A\001\022A\n\013node_config\030\021 \001" + + "(\0132\'.google.cloud.memorystore.v1.NodeCon" + + "figB\003\340A\003\022]\n\030zone_distribution_config\030\022 \001" + + "(\01323.google.cloud.memorystore.v1.ZoneDis" + + "tributionConfigB\006\340A\001\340A\005\022-\n\033deletion_prot" + + "ection_enabled\030\023 \001(\010B\003\340A\001H\001\210\001\001\022T\n\024psc_au" + + "to_connections\030\024 \003(\0132..google.cloud.memo" + + "rystore.v1.PscAutoConnectionB\006\340A\002\340A\005\022N\n\t" + + "endpoints\030\031 \003(\01326.google.cloud.memorysto" + + "re.v1.Instance.InstanceEndpointB\003\340A\001\022=\n\004" + + "mode\030\032 \001(\0162*.google.cloud.memorystore.v1" + + ".Instance.ModeB\003\340A\001\032\370\001\n\tStateInfo\022V\n\013upd" + + "ate_info\030\001 \001(\0132:.google.cloud.memorystor" + + "e.v1.Instance.StateInfo.UpdateInfoB\003\340A\003H" + + "\000\032\212\001\n\nUpdateInfo\022$\n\022target_shard_count\030\001" + + " \001(\005B\003\340A\003H\000\210\001\001\022&\n\024target_replica_count\030\002" + + " \001(\005B\003\340A\003H\001\210\001\001B\025\n\023_target_shard_countB\027\n" + + "\025_target_replica_countB\006\n\004info\032d\n\020Instan" + + "ceEndpoint\022P\n\013connections\030\001 \003(\01326.google" + + ".cloud.memorystore.v1.Instance.Connectio" + + "nDetailB\003\340A\001\032\265\001\n\020ConnectionDetail\022M\n\023psc" + + "_auto_connection\030\001 \001(\0132..google.cloud.me" + + "morystore.v1.PscAutoConnectionH\000\022D\n\016psc_" + + "connection\030\002 \001(\0132*.google.cloud.memoryst" + + "ore.v1.PscConnectionH\000B\014\n\nconnection\032-\n\013" + + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\0324\n\022EngineConfigsEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001\"T\n\005State\022\025\n\021STATE_UNSP" + + "ECIFIED\020\000\022\014\n\010CREATING\020\001\022\n\n\006ACTIVE\020\002\022\014\n\010U" + + "PDATING\020\003\022\014\n\010DELETING\020\004\"X\n\021Authorization" + + "Mode\022\"\n\036AUTHORIZATION_MODE_UNSPECIFIED\020\000" + + "\022\021\n\rAUTH_DISABLED\020\001\022\014\n\010IAM_AUTH\020\002\"|\n\025Tra" + + "nsitEncryptionMode\022\'\n#TRANSIT_ENCRYPTION" + + "_MODE_UNSPECIFIED\020\000\022\037\n\033TRANSIT_ENCRYPTIO" + + "N_DISABLED\020\001\022\031\n\025SERVER_AUTHENTICATION\020\002\"" + + "w\n\010NodeType\022\031\n\025NODE_TYPE_UNSPECIFIED\020\000\022\024" + + "\n\020SHARED_CORE_NANO\020\001\022\022\n\016HIGHMEM_MEDIUM\020\002" + + "\022\022\n\016HIGHMEM_XLARGE\020\003\022\022\n\016STANDARD_SMALL\020\004" + + "\"9\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\016\n\nSTANDA" + + "LONE\020\001\022\013\n\007CLUSTER\020\002:{\352Ax\n#memorystore.go" + + "ogleapis.com/Instance\022.google.cloud.memory" + + "store.v1.PersistenceConfig.PersistenceMo" + + "deB\003\340A\001\022Q\n\nrdb_config\030\002 \001(\01328.google.clo" + + "ud.memorystore.v1.PersistenceConfig.RDBC" + + "onfigB\003\340A\001\022Q\n\naof_config\030\003 \001(\01328.google." + + "cloud.memorystore.v1.PersistenceConfig.A" + + "OFConfigB\003\340A\001\032\261\002\n\tRDBConfig\022i\n\023rdb_snaps" + + "hot_period\030\001 \001(\0162G.google.cloud.memoryst" + + "ore.v1.PersistenceConfig.RDBConfig.Snaps" + + "hotPeriodB\003\340A\001\022@\n\027rdb_snapshot_start_tim" + + "e\030\002 \001(\0132\032.google.protobuf.TimestampB\003\340A\001" + + "\"w\n\016SnapshotPeriod\022\037\n\033SNAPSHOT_PERIOD_UN" + + "SPECIFIED\020\000\022\014\n\010ONE_HOUR\020\001\022\r\n\tSIX_HOURS\020\002" + + "\022\020\n\014TWELVE_HOURS\020\003\022\025\n\021TWENTY_FOUR_HOURS\020" + + "\004\032\277\001\n\tAOFConfig\022_\n\014append_fsync\030\001 \001(\0162D." + + "google.cloud.memorystore.v1.PersistenceC" + + "onfig.AOFConfig.AppendFsyncB\003\340A\001\"Q\n\013Appe" + + "ndFsync\022\034\n\030APPEND_FSYNC_UNSPECIFIED\020\000\022\t\n" + + "\005NEVER\020\001\022\r\n\tEVERY_SEC\020\002\022\n\n\006ALWAYS\020\003\"S\n\017P" + + "ersistenceMode\022 \n\034PERSISTENCE_MODE_UNSPE" + + "CIFIED\020\000\022\014\n\010DISABLED\020\001\022\007\n\003RDB\020\002\022\007\n\003AOF\020\003" + + "\"\"\n\nNodeConfig\022\024\n\007size_gb\030\001 \001(\001B\003\340A\003\"\351\001\n" + + "\026ZoneDistributionConfig\022\021\n\004zone\030\002 \001(\tB\003\340" + + "A\001\022[\n\004mode\030\001 \001(\0162H.google.cloud.memoryst" + + "ore.v1.ZoneDistributionConfig.ZoneDistri" + + "butionModeB\003\340A\001\"_\n\024ZoneDistributionMode\022" + + "&\n\"ZONE_DISTRIBUTION_MODE_UNSPECIFIED\020\000\022" + + "\016\n\nMULTI_ZONE\020\001\022\017\n\013SINGLE_ZONE\020\002\"\260\001\n\024Lis" + + "tInstancesRequest\022;\n\006parent\030\001 \001(\tB+\340A\002\372A" + + "%\022#memorystore.googleapis.com/Instance\022\026" + + "\n\tpage_size\030\002 \001(\005B\003\340A\001\022\027\n\npage_token\030\003 \001" + + "(\tB\003\340A\001\022\023\n\006filter\030\004 \001(\tB\003\340A\001\022\025\n\010order_by" + + "\030\005 \001(\tB\003\340A\001\"\177\n\025ListInstancesResponse\0228\n\t" + + "instances\030\001 \003(\0132%.google.cloud.memorysto" + + "re.v1.Instance\022\027\n\017next_page_token\030\002 \001(\t\022" + + "\023\n\013unreachable\030\003 \003(\t\"O\n\022GetInstanceReque" + + "st\0229\n\004name\030\001 \001(\tB+\340A\002\372A%\n#memorystore.go" + + "ogleapis.com/Instance\"\315\001\n\025CreateInstance" + + "Request\022;\n\006parent\030\001 \001(\tB+\340A\002\372A%\022#memorys" + + "tore.googleapis.com/Instance\022\030\n\013instance" + + "_id\030\002 \001(\tB\003\340A\002\022<\n\010instance\030\003 \001(\0132%.googl" + + "e.cloud.memorystore.v1.InstanceB\003\340A\002\022\037\n\n" + + "request_id\030\004 \001(\tB\013\340A\001\342\214\317\327\010\002\010\001\"\254\001\n\025Update" + + "InstanceRequest\0224\n\013update_mask\030\001 \001(\0132\032.g" + + "oogle.protobuf.FieldMaskB\003\340A\001\022<\n\010instanc" + + "e\030\002 \001(\0132%.google.cloud.memorystore.v1.In" + + "stanceB\003\340A\002\022\037\n\nrequest_id\030\003 \001(\tB\013\340A\001\342\214\317\327" + + "\010\002\010\001\"s\n\025DeleteInstanceRequest\0229\n\004name\030\001 " + + "\001(\tB+\340A\002\372A%\n#memorystore.googleapis.com/" + + "Instance\022\037\n\nrequest_id\030\002 \001(\tB\013\340A\001\342\214\317\327\010\002\010" + + "\001\"[\n\036GetCertificateAuthorityRequest\0229\n\004n" + + "ame\030\001 \001(\tB+\340A\002\372A%\n#memorystore.googleapi" + + "s.com/Instance\"\211\004\n\024CertificateAuthority\022" + + "j\n\021managed_server_ca\030\002 \001(\0132M.google.clou" + + "d.memorystore.v1.CertificateAuthority.Ma" + + "nagedCertificateAuthorityH\000\022\021\n\004name\030\001 \001(" + + "\tB\003\340A\010\032\253\001\n\033ManagedCertificateAuthority\022i" + + "\n\010ca_certs\030\001 \003(\0132W.google.cloud.memoryst" + + "ore.v1.CertificateAuthority.ManagedCerti" + + "ficateAuthority.CertChain\032!\n\tCertChain\022\024" + + "\n\014certificates\030\001 \003(\t:\266\001\352A\262\001\n/memorystore" + + ".googleapis.com/CertificateAuthority\022Qpr" + + "ojects/{project}/locations/{location}/in" + + "stances/{instance}/certificateAuthority*" + + "\026certificateAuthorities2\024certificateAuth" + + "orityB\013\n\tserver_ca\"\200\002\n\021OperationMetadata" + + "\0224\n\013create_time\030\001 \001(\0132\032.google.protobuf." + + "TimestampB\003\340A\003\0221\n\010end_time\030\002 \001(\0132\032.googl" + + "e.protobuf.TimestampB\003\340A\003\022\023\n\006target\030\003 \001(" + + "\tB\003\340A\003\022\021\n\004verb\030\004 \001(\tB\003\340A\003\022\033\n\016status_mess" + + "age\030\005 \001(\tB\003\340A\003\022#\n\026requested_cancellation" + + "\030\006 \001(\010B\003\340A\003\022\030\n\013api_version\030\007 \001(\tB\003\340A\003*W\n" + + "\023PscConnectionStatus\022%\n!PSC_CONNECTION_S" + + "TATUS_UNSPECIFIED\020\000\022\n\n\006ACTIVE\020\001\022\r\n\tNOT_F" + + "OUND\020\002*\211\001\n\016ConnectionType\022\037\n\033CONNECTION_" + + "TYPE_UNSPECIFIED\020\000\022\035\n\031CONNECTION_TYPE_DI" + + "SCOVERY\020\001\022\033\n\027CONNECTION_TYPE_PRIMARY\020\002\022\032" + + "\n\026CONNECTION_TYPE_READER\020\0032\270\n\n\013Memorysto" + + "re\022\266\001\n\rListInstances\0221.google.cloud.memo" + + "rystore.v1.ListInstancesRequest\0322.google" + + ".cloud.memorystore.v1.ListInstancesRespo" + + "nse\">\332A\006parent\202\323\344\223\002/\022-/v1/{parent=projec" + + "ts/*/locations/*}/instances\022\243\001\n\013GetInsta" + + "nce\022/.google.cloud.memorystore.v1.GetIns" + + "tanceRequest\032%.google.cloud.memorystore." + + "v1.Instance\"<\332A\004name\202\323\344\223\002/\022-/v1/{name=pr" + + "ojects/*/locations/*/instances/*}\022\342\001\n\016Cr" + + "eateInstance\0222.google.cloud.memorystore." + + "v1.CreateInstanceRequest\032\035.google.longru" + + "nning.Operation\"}\312A\035\n\010Instance\022\021Operatio" + + "nMetadata\332A\033parent,instance,instance_id\202" + + "\323\344\223\0029\"-/v1/{parent=projects/*/locations/" + + "*}/instances:\010instance\022\344\001\n\016UpdateInstanc" + + "e\0222.google.cloud.memorystore.v1.UpdateIn" + + "stanceRequest\032\035.google.longrunning.Opera" + + "tion\"\177\312A\035\n\010Instance\022\021OperationMetadata\332A" + + "\024instance,update_mask\202\323\344\223\002B26/v1/{instan" + + "ce.name=projects/*/locations/*/instances" + + "/*}:\010instance\022\316\001\n\016DeleteInstance\0222.googl" + + "e.cloud.memorystore.v1.DeleteInstanceReq" + + "uest\032\035.google.longrunning.Operation\"i\312A*" + + "\n\025google.protobuf.Empty\022\021OperationMetada" + + "ta\332A\004name\202\323\344\223\002/*-/v1/{name=projects/*/lo" + + "cations/*/instances/*}\022\334\001\n\027GetCertificat" + + "eAuthority\022;.google.cloud.memorystore.v1" + + ".GetCertificateAuthorityRequest\0321.google" + + ".cloud.memorystore.v1.CertificateAuthori" + + "ty\"Q\332A\004name\202\323\344\223\002D\022B/v1/{name=projects/*/" + + "locations/*/instances/*}/certificateAuth" + + "ority\032N\312A\032memorystore.googleapis.com\322A.h" + + "ttps://www.googleapis.com/auth/cloud-pla" + + "tformB\214\004\n\037com.google.cloud.memorystore.v" + + "1B\013V1mainProtoP\001ZAcloud.google.com/go/me" + + "morystore/apiv1/memorystorepb;memorystor" + + "epb\252\002\033Google.Cloud.Memorystore.V1\312\002\033Goog" + + "le\\Cloud\\Memorystore\\V1\352\002\036Google::Cloud:" + + ":Memorystore::V1\352An\n%compute.googleapis." + + "com/ForwardingRule\022Eprojects/{project}/r" + + "egions/{region}/forwardingRules/{forward" + + "ing_rule}\352AN\n\036compute.googleapis.com/Net" + + "work\022,projects/{project}/global/networks" + + "/{network}\352Aw\n(compute.googleapis.com/Se" + + "rviceAttachment\022Kprojects/{project}/regi" + + "ons/{region}/serviceAttachments/{service" + + "_attachment}b\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.FieldInfoProto.getDescriptor(), + com.google.api.ResourceProto.getDescriptor(), + com.google.longrunning.OperationsProto.getDescriptor(), + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.FieldMaskProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }); + internal_static_google_cloud_memorystore_v1_Instance_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_cloud_memorystore_v1_Instance_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_Instance_descriptor, + new java.lang.String[] { + "Name", + "CreateTime", + "UpdateTime", + "Labels", + "State", + "StateInfo", + "Uid", + "ReplicaCount", + "AuthorizationMode", + "TransitEncryptionMode", + "ShardCount", + "DiscoveryEndpoints", + "NodeType", + "PersistenceConfig", + "EngineVersion", + "EngineConfigs", + "NodeConfig", + "ZoneDistributionConfig", + "DeletionProtectionEnabled", + "PscAutoConnections", + "Endpoints", + "Mode", + }); + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_descriptor = + internal_static_google_cloud_memorystore_v1_Instance_descriptor.getNestedTypes().get(0); + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_descriptor, + new java.lang.String[] { + "UpdateInfo", "Info", + }); + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_descriptor = + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_Instance_StateInfo_UpdateInfo_descriptor, + new java.lang.String[] { + "TargetShardCount", "TargetReplicaCount", + }); + internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_descriptor = + internal_static_google_cloud_memorystore_v1_Instance_descriptor.getNestedTypes().get(1); + internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_Instance_InstanceEndpoint_descriptor, + new java.lang.String[] { + "Connections", + }); + internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_descriptor = + internal_static_google_cloud_memorystore_v1_Instance_descriptor.getNestedTypes().get(2); + internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_Instance_ConnectionDetail_descriptor, + new java.lang.String[] { + "PscAutoConnection", "PscConnection", "Connection", + }); + internal_static_google_cloud_memorystore_v1_Instance_LabelsEntry_descriptor = + internal_static_google_cloud_memorystore_v1_Instance_descriptor.getNestedTypes().get(3); + internal_static_google_cloud_memorystore_v1_Instance_LabelsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_Instance_LabelsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_memorystore_v1_Instance_EngineConfigsEntry_descriptor = + internal_static_google_cloud_memorystore_v1_Instance_descriptor.getNestedTypes().get(4); + internal_static_google_cloud_memorystore_v1_Instance_EngineConfigsEntry_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_Instance_EngineConfigsEntry_descriptor, + new java.lang.String[] { + "Key", "Value", + }); + internal_static_google_cloud_memorystore_v1_PscAutoConnection_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_cloud_memorystore_v1_PscAutoConnection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_PscAutoConnection_descriptor, + new java.lang.String[] { + "Port", + "PscConnectionId", + "IpAddress", + "ForwardingRule", + "ProjectId", + "Network", + "ServiceAttachment", + "PscConnectionStatus", + "ConnectionType", + "Ports", + }); + internal_static_google_cloud_memorystore_v1_PscConnection_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_cloud_memorystore_v1_PscConnection_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_PscConnection_descriptor, + new java.lang.String[] { + "PscConnectionId", + "IpAddress", + "ForwardingRule", + "ProjectId", + "Network", + "ServiceAttachment", + "PscConnectionStatus", + "ConnectionType", + }); + internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_DiscoveryEndpoint_descriptor, + new java.lang.String[] { + "Address", "Port", "Network", + }); + internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_google_cloud_memorystore_v1_PersistenceConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor, + new java.lang.String[] { + "Mode", "RdbConfig", "AofConfig", + }); + internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_descriptor = + internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_PersistenceConfig_RDBConfig_descriptor, + new java.lang.String[] { + "RdbSnapshotPeriod", "RdbSnapshotStartTime", + }); + internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_descriptor = + internal_static_google_cloud_memorystore_v1_PersistenceConfig_descriptor + .getNestedTypes() + .get(1); + internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_PersistenceConfig_AOFConfig_descriptor, + new java.lang.String[] { + "AppendFsync", + }); + internal_static_google_cloud_memorystore_v1_NodeConfig_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_google_cloud_memorystore_v1_NodeConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_NodeConfig_descriptor, + new java.lang.String[] { + "SizeGb", + }); + internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_descriptor, + new java.lang.String[] { + "Zone", "Mode", + }); + internal_static_google_cloud_memorystore_v1_ListInstancesRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_google_cloud_memorystore_v1_ListInstancesRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_ListInstancesRequest_descriptor, + new java.lang.String[] { + "Parent", "PageSize", "PageToken", "Filter", "OrderBy", + }); + internal_static_google_cloud_memorystore_v1_ListInstancesResponse_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_google_cloud_memorystore_v1_ListInstancesResponse_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_ListInstancesResponse_descriptor, + new java.lang.String[] { + "Instances", "NextPageToken", "Unreachable", + }); + internal_static_google_cloud_memorystore_v1_GetInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_google_cloud_memorystore_v1_GetInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_GetInstanceRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_CreateInstanceRequest_descriptor, + new java.lang.String[] { + "Parent", "InstanceId", "Instance", "RequestId", + }); + internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_UpdateInstanceRequest_descriptor, + new java.lang.String[] { + "UpdateMask", "Instance", "RequestId", + }); + internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_DeleteInstanceRequest_descriptor, + new java.lang.String[] { + "Name", "RequestId", + }); + internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_GetCertificateAuthorityRequest_descriptor, + new java.lang.String[] { + "Name", + }); + internal_static_google_cloud_memorystore_v1_CertificateAuthority_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_google_cloud_memorystore_v1_CertificateAuthority_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_CertificateAuthority_descriptor, + new java.lang.String[] { + "ManagedServerCa", "Name", "ServerCa", + }); + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_descriptor = + internal_static_google_cloud_memorystore_v1_CertificateAuthority_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_descriptor, + new java.lang.String[] { + "CaCerts", + }); + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor = + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_descriptor + .getNestedTypes() + .get(0); + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_v1_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor, + new java.lang.String[] { + "Certificates", + }); + internal_static_google_cloud_memorystore_v1_OperationMetadata_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_google_cloud_memorystore_v1_OperationMetadata_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_cloud_memorystore_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.FieldInfoProto.fieldInfo); + 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.resourceDefinition); + 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.FieldInfoProto.getDescriptor(); + com.google.api.ResourceProto.getDescriptor(); + com.google.longrunning.OperationsProto.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-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ZoneDistributionConfig.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ZoneDistributionConfig.java new file mode 100644 index 000000000000..97fec52185f6 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ZoneDistributionConfig.java @@ -0,0 +1,972 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +/** + * + * + *
+ * Zone distribution configuration for allocation of instance resources.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.ZoneDistributionConfig} + */ +public final class ZoneDistributionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1.ZoneDistributionConfig) + ZoneDistributionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ZoneDistributionConfig.newBuilder() to construct. + private ZoneDistributionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ZoneDistributionConfig() { + zone_ = ""; + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ZoneDistributionConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.ZoneDistributionConfig.class, + com.google.cloud.memorystore.v1.ZoneDistributionConfig.Builder.class); + } + + /** + * + * + *
+   * Possible zone distribution modes.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode} + */ + public enum ZoneDistributionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not Set. Default: MULTI_ZONE
+     * 
+ * + * ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + */ + ZONE_DISTRIBUTION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Distribute resources across 3 zones picked at random within the
+     * region.
+     * 
+ * + * MULTI_ZONE = 1; + */ + MULTI_ZONE(1), + /** + * + * + *
+     * Provision resources in a single zone. Zone field must be specified.
+     * 
+ * + * SINGLE_ZONE = 2; + */ + SINGLE_ZONE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not Set. Default: MULTI_ZONE
+     * 
+ * + * ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + */ + public static final int ZONE_DISTRIBUTION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Distribute resources across 3 zones picked at random within the
+     * region.
+     * 
+ * + * MULTI_ZONE = 1; + */ + public static final int MULTI_ZONE_VALUE = 1; + /** + * + * + *
+     * Provision resources in a single zone. Zone field must be specified.
+     * 
+ * + * SINGLE_ZONE = 2; + */ + public static final int SINGLE_ZONE_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 ZoneDistributionMode 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 ZoneDistributionMode forNumber(int value) { + switch (value) { + case 0: + return ZONE_DISTRIBUTION_MODE_UNSPECIFIED; + case 1: + return MULTI_ZONE; + case 2: + return SINGLE_ZONE; + 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 ZoneDistributionMode findValueByNumber(int number) { + return ZoneDistributionMode.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.memorystore.v1.ZoneDistributionConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ZoneDistributionMode[] VALUES = values(); + + public static ZoneDistributionMode 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 ZoneDistributionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode) + } + + public static final int ZONE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object zone_ = ""; + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The zone. + */ + @java.lang.Override + public java.lang.String getZone() { + java.lang.Object ref = zone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zone_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for zone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneBytes() { + java.lang.Object ref = zone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode getMode() { + com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode result = + com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode.forNumber( + mode_); + return result == null + ? com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (mode_ + != com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode + .ZONE_DISTRIBUTION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, zone_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode + .ZONE_DISTRIBUTION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, zone_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1.ZoneDistributionConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1.ZoneDistributionConfig other = + (com.google.cloud.memorystore.v1.ZoneDistributionConfig) obj; + + if (!getZone().equals(other.getZone())) return false; + if (mode_ != other.mode_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ZONE_FIELD_NUMBER; + hash = (53 * hash) + getZone().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1.ZoneDistributionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Zone distribution configuration for allocation of instance resources.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1.ZoneDistributionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1.ZoneDistributionConfig) + com.google.cloud.memorystore.v1.ZoneDistributionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1.ZoneDistributionConfig.class, + com.google.cloud.memorystore.v1.ZoneDistributionConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1.ZoneDistributionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + zone_ = ""; + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1.V1mainProto + .internal_static_google_cloud_memorystore_v1_ZoneDistributionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfig getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1.ZoneDistributionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfig build() { + com.google.cloud.memorystore.v1.ZoneDistributionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfig buildPartial() { + com.google.cloud.memorystore.v1.ZoneDistributionConfig result = + new com.google.cloud.memorystore.v1.ZoneDistributionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1.ZoneDistributionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.zone_ = zone_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mode_ = mode_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1.ZoneDistributionConfig) { + return mergeFrom((com.google.cloud.memorystore.v1.ZoneDistributionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1.ZoneDistributionConfig other) { + if (other == com.google.cloud.memorystore.v1.ZoneDistributionConfig.getDefaultInstance()) + return this; + if (!other.getZone().isEmpty()) { + zone_ = other.zone_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 8 + case 18: + { + zone_ = 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 zone_ = ""; + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The zone. + */ + public java.lang.String getZone() { + java.lang.Object ref = zone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for zone. + */ + public com.google.protobuf.ByteString getZoneBytes() { + java.lang.Object ref = zone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The zone to set. + * @return This builder for chaining. + */ + public Builder setZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zone_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearZone() { + zone_ = getDefaultInstance().getZone(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for zone to set. + * @return This builder for chaining. + */ + public Builder setZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zone_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int mode_ = 0; + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode getMode() { + com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode result = + com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode.forNumber( + mode_); + return result == null + ? com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000002); + mode_ = 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.memorystore.v1.ZoneDistributionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1.ZoneDistributionConfig) + private static final com.google.cloud.memorystore.v1.ZoneDistributionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1.ZoneDistributionConfig(); + } + + public static com.google.cloud.memorystore.v1.ZoneDistributionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ZoneDistributionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1.ZoneDistributionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ZoneDistributionConfigOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ZoneDistributionConfigOrBuilder.java new file mode 100644 index 000000000000..c63690b1a50e --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/java/com/google/cloud/memorystore/v1/ZoneDistributionConfigOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1; + +public interface ZoneDistributionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1.ZoneDistributionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The zone. + */ + java.lang.String getZone(); + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for zone. + */ + com.google.protobuf.ByteString getZoneBytes(); + + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.memorystore.v1.ZoneDistributionConfig.ZoneDistributionMode getMode(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1/src/main/proto/google/cloud/memorystore/v1/memorystore.proto b/java-valkey/proto-google-cloud-valkey-v1/src/main/proto/google/cloud/memorystore/v1/memorystore.proto new file mode 100644 index 000000000000..eede5815eab7 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1/src/main/proto/google/cloud/memorystore/v1/memorystore.proto @@ -0,0 +1,857 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.memorystore.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Memorystore.V1"; +option go_package = "cloud.google.com/go/memorystore/apiv1/memorystorepb;memorystorepb"; +option java_multiple_files = true; +option java_outer_classname = "V1mainProto"; +option java_package = "com.google.cloud.memorystore.v1"; +option php_namespace = "Google\\Cloud\\Memorystore\\V1"; +option ruby_package = "Google::Cloud::Memorystore::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ForwardingRule" + pattern: "projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ServiceAttachment" + pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" +}; + +// Service describing handlers for resources +service Memorystore { + option (google.api.default_host) = "memorystore.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets details about the certificate authority for an Instance. + rpc GetCertificateAuthority(GetCertificateAuthorityRequest) + returns (CertificateAuthority) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}/certificateAuthority" + }; + option (google.api.method_signature) = "name"; + } +} + +// Status of the PSC connection. +enum PscConnectionStatus { + // PSC connection status is not specified. + PSC_CONNECTION_STATUS_UNSPECIFIED = 0; + + // The connection is active + ACTIVE = 1; + + // Connection not found + NOT_FOUND = 2; +} + +// Type of a PSC connection +enum ConnectionType { + // Connection Type is not set + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Connection that will be used for topology discovery. + CONNECTION_TYPE_DISCOVERY = 1; + + // Connection that will be used as primary endpoint to access primary. + CONNECTION_TYPE_PRIMARY = 2; + + // Connection that will be used as reader endpoint to access replicas. + CONNECTION_TYPE_READER = 3; +} + +// A Memorystore instance. +message Instance { + option (google.api.resource) = { + type: "memorystore.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // Additional information about the state of the instance. + message StateInfo { + // Represents information about instance with state UPDATING. + message UpdateInfo { + // Output only. Target number of shards for the instance. + optional int32 target_shard_count = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Target number of replica nodes per shard for the instance. + optional int32 target_replica_count = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + oneof info { + // Output only. Describes ongoing update when instance state is UPDATING. + UpdateInfo update_info = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + } + + // InstanceEndpoint consists of PSC connections that are created + // as a group in each VPC network for accessing the instance. In each group, + // there shall be one connection for each service attachment in the cluster. + message InstanceEndpoint { + // Optional. A group of PSC connections. They are created in the same VPC + // network, one for each service attachment in the cluster. + repeated ConnectionDetail connections = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Information of each PSC connection. + message ConnectionDetail { + // A PSC connection to an instance could either be created through Service + // Connectivity Automation (auto connection) during the cluster creation, + // or it could be created by customer themeslves (user-created connection). + oneof connection { + // Detailed information of a PSC connection that is created through + // service connectivity automation. + PscAutoConnection psc_auto_connection = 1; + + // Detailed information of a PSC connection that is created by the user. + PscConnection psc_connection = 2; + } + } + + // Possible states of the instance. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // Instance is being created. + CREATING = 1; + + // Instance has been created and is usable. + ACTIVE = 2; + + // Instance is being updated. + UPDATING = 3; + + // Instance is being deleted. + DELETING = 4; + } + + // Possible authorization modes of the instance. + enum AuthorizationMode { + // Not set. + AUTHORIZATION_MODE_UNSPECIFIED = 0; + + // Authorization disabled. + AUTH_DISABLED = 1; + + // IAM basic authorization. + IAM_AUTH = 2; + } + + // Possible in-transit encryption modes of the instance. + enum TransitEncryptionMode { + // Not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + + // In-transit encryption is disabled. + TRANSIT_ENCRYPTION_DISABLED = 1; + + // Server-managed encryption is used for in-transit encryption. + SERVER_AUTHENTICATION = 2; + } + + // Possible node types of the instance. See + // https://cloud.google.com/memorystore/docs/valkey/instance-node-specification + // for more information. + enum NodeType { + // Not set. + NODE_TYPE_UNSPECIFIED = 0; + + // Shared core nano. + SHARED_CORE_NANO = 1; + + // High memory medium. + HIGHMEM_MEDIUM = 2; + + // High memory extra large. + HIGHMEM_XLARGE = 3; + + // Standard small. + STANDARD_SMALL = 4; + } + + // The mode config, which is used to enable/disable cluster mode. + enum Mode { + // Mode is not specified. + MODE_UNSPECIFIED = 0; + + // Instance is in standalone mode. + STANDALONE = 1; + + // Instance is in cluster mode. + CLUSTER = 2; + } + + // Identifier. Unique name of the instance. + // Format: projects/{project}/locations/{location}/instances/{instance} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Creation timestamp of the instance. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Latest update timestamp of the instance. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels to represent user-provided metadata. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the instance. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the state of the instance. + StateInfo state_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. System assigned, unique identifier for the instance. + string uid = 7 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Number of replica nodes per shard. If omitted the default is 0 + // replicas. + optional int32 replica_count = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Authorization mode of the instance. + AuthorizationMode authorization_mode = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. In-transit encryption mode of the instance. + TransitEncryptionMode transit_encryption_mode = 10 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Number of shards for the instance. + int32 shard_count = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Endpoints clients can connect to the instance through. + // Currently only one discovery endpoint is supported. + repeated DiscoveryEndpoint discovery_endpoints = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. Machine type for individual nodes of the instance. + NodeType node_type = 13 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Persistence configuration of the instance. + PersistenceConfig persistence_config = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Engine version of the instance. + string engine_version = 15 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. User-provided engine configurations for the instance. + map engine_configs = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Configuration of individual nodes of the instance. + NodeConfig node_config = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. Zone distribution configuration of the instance for + // node allocation. + ZoneDistributionConfig zone_distribution_config = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. If set to true deletion of the instance will fail. + optional bool deletion_protection_enabled = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. User inputs and resource details of the auto-created + // PSC connections. + repeated PscAutoConnection psc_auto_connections = 20 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Endpoints for the instance. + repeated InstanceEndpoint endpoints = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The mode config for the instance. + Mode mode = 26 [(google.api.field_behavior) = OPTIONAL]; +} + +// Details of consumer resources in a PSC connection. +message PscAutoConnection { + // Ports of the exposed endpoint. + oneof ports { + // Optional. Output only. port will only be set for Primary/Reader or + // Discovery endpoint. + int32 port = 9 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + } + + // 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 ip_address = 2 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The URI of the consumer side forwarding rule. + // Format: + // projects/{project}/regions/{region}/forwardingRules/{forwarding_rule} + string forwarding_rule = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Required. The consumer project_id where PSC connections are established. + // This should be the same project_id that the instance is being created in. + string project_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network where the PSC endpoints are created, in the form of + // projects/{project_id}/global/networks/{network_id}. + string network = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Output only. The service attachment which is the target of the PSC + // connection, in the form of + // projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}. + string service_attachment = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceAttachment" + } + ]; + + // Output only. The status of the PSC connection: whether a connection exists + // and ACTIVE or it no longer exists. Please note that this value is updated + // periodically. Please use Private Service Connect APIs for the latest + // status. + PscConnectionStatus psc_connection_status = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of the PSC connection. + ConnectionType connection_type = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// User created Psc connection configuration. +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]; + + // Required. The IP allocated on the consumer network for the PSC forwarding + // rule. + string ip_address = 2 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. The URI of the consumer side forwarding rule. + // Format: + // projects/{project}/regions/{region}/forwardingRules/{forwarding_rule} + string forwarding_rule = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Output only. The consumer project_id where the forwarding rule is created + // from. + string project_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The consumer network where the IP address resides, in the form of + // projects/{project_id}/global/networks/{network_id}. + string network = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Required. The service attachment which is the target of the PSC connection, + // in the form of + // projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}. + string service_attachment = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceAttachment" + } + ]; + + // Output only. The status of the PSC connection: whether a connection exists + // and ACTIVE or it no longer exists. Please note that this value is updated + // periodically. Please use Private Service Connect APIs for the latest + // status. + PscConnectionStatus psc_connection_status = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of the PSC connection. + ConnectionType connection_type = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents an endpoint for clients to connect to the instance. +message DiscoveryEndpoint { + // Output only. IP address of the exposed endpoint clients connect to. + string address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the exposed endpoint. + int32 port = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; +} + +// Represents persistence configuration for a instance. +message PersistenceConfig { + // Configuration for RDB based persistence. + message RDBConfig { + // Possible snapshot periods. + enum SnapshotPeriod { + // Not set. + SNAPSHOT_PERIOD_UNSPECIFIED = 0; + + // One hour. + ONE_HOUR = 1; + + // Six hours. + SIX_HOURS = 2; + + // Twelve hours. + TWELVE_HOURS = 3; + + // Twenty four hours. + TWENTY_FOUR_HOURS = 4; + } + + // Optional. Period between RDB snapshots. + SnapshotPeriod rdb_snapshot_period = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time that the first snapshot was/will be attempted, and to + // which future snapshots will be aligned. If not provided, the current time + // will be used. + google.protobuf.Timestamp rdb_snapshot_start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for AOF based persistence. + message AOFConfig { + // Possible fsync modes. + enum AppendFsync { + // Not set. Default: EVERY_SEC + APPEND_FSYNC_UNSPECIFIED = 0; + + // Never fsync. Normally Linux will flush data every 30 seconds with this + // configuration, but it's up to the kernel's exact tuning. + NEVER = 1; + + // Fsync every second. You may lose 1 second of data if there is a + // disaster. + EVERY_SEC = 2; + + // Fsync every time new write commands are appended to the AOF. The best + // data loss protection at the cost of performance. + ALWAYS = 3; + } + + // Optional. The fsync mode. + AppendFsync append_fsync = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Possible persistence modes. + enum PersistenceMode { + // Not set. + PERSISTENCE_MODE_UNSPECIFIED = 0; + + // Persistence is disabled, and any snapshot data is deleted. + DISABLED = 1; + + // RDB based persistence is enabled. + RDB = 2; + + // AOF based persistence is enabled. + AOF = 3; + } + + // Optional. Current persistence mode. + PersistenceMode mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. RDB configuration. This field will be ignored if mode is not RDB. + RDBConfig rdb_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. AOF configuration. This field will be ignored if mode is not AOF. + AOFConfig aof_config = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents configuration for nodes of the instance. +message NodeConfig { + // Output only. Memory size in GB of the node. + double size_gb = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Zone distribution configuration for allocation of instance resources. +message ZoneDistributionConfig { + // Possible zone distribution modes. + enum ZoneDistributionMode { + // Not Set. Default: MULTI_ZONE + ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + + // Distribute resources across 3 zones picked at random within the + // region. + MULTI_ZONE = 1; + + // Provision resources in a single zone. Zone field must be specified. + SINGLE_ZONE = 2; + } + + // Optional. Defines zone where all resources will be allocated with + // SINGLE_ZONE mode. Ignored for MULTI_ZONE mode. + string zone = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Current zone distribution mode. Defaults to MULTI_ZONE. + ZoneDistributionMode mode = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [ListInstances][]. +message ListInstancesRequest { + // Required. The parent to list instances from. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "memorystore.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Expression for filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort results by a defined order. Supported values: "name", + // "create_time". + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [ListInstances][]. +message ListInstancesResponse { + // If the {location} requested was "-" the response contains a list of + // instances from all locations. Instances in unreachable locations will be + // omitted. + repeated Instance instances = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for [GetInstance][]. +message GetInstanceRequest { + // Required. The name of the instance to retrieve. + // Format: projects/{project}/locations/{location}/instances/{instance} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memorystore.googleapis.com/Instance" + } + ]; +} + +// Request message for [CreateInstance][]. +message CreateInstanceRequest { + // Required. The parent resource where this instance will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "memorystore.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the instance, which will become the final + // component of the instance's resource name. + // + // This value is subject to the following restrictions: + // + // * Must be 4-63 characters in length + // * Must begin with a letter or digit + // * Must contain only lowercase letters, digits, and hyphens + // * Must not end with a hyphen + // * Must be unique within a location + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to create. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for [UpdateInstance][]. +message UpdateInstanceRequest { + // Optional. The list of fields to be updated on the instance. At least one + // field must be specified. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The instance to update. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for [DeleteInstance][]. +message DeleteInstanceRequest { + // Required. The name of the instance to delete. + // Format: projects/{project}/locations/{location}/instances/{instance} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memorystore.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for [GetCertificateAuthority][]. +message GetCertificateAuthorityRequest { + // Required. The name of the certificate authority. + // Format: + // projects/{project}/locations/{location}/instances/{instance}/certificateAuthority + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memorystore.googleapis.com/Instance" + } + ]; +} + +// A certificate authority for an instance. +message CertificateAuthority { + option (google.api.resource) = { + type: "memorystore.googleapis.com/CertificateAuthority" + pattern: "projects/{project}/locations/{location}/instances/{instance}/certificateAuthority" + plural: "certificateAuthorities" + singular: "certificateAuthority" + }; + + // A managed certificate authority. + message ManagedCertificateAuthority { + // A certificate chain. + message CertChain { + // The certificates that form the CA chain in order of leaf to root. + repeated string certificates = 1; + } + + // PEM encoded CA certificate chains for managed server authentication. + repeated CertChain ca_certs = 1; + } + + // Information about the server certificate authority. + oneof server_ca { + // A managed server certificate authority. + ManagedCertificateAuthority managed_server_ca = 2; + } + + // Identifier. Unique name of the certificate authority. + // Format: + // projects/{project}/locations/{location}/instances/{instance} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; +} + +// Represents the metadata of a long-running operation. +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 been cancelled successfully + // 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-valkey/proto-google-cloud-valkey-v1beta/clirr-ignored-differences.xml b/java-valkey/proto-google-cloud-valkey-v1beta/clirr-ignored-differences.xml new file mode 100644 index 000000000000..70e35c15384c --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/clirr-ignored-differences.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/pom.xml b/java-valkey/proto-google-cloud-valkey-v1beta/pom.xml new file mode 100644 index 000000000000..ea04286a4f27 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/pom.xml @@ -0,0 +1,37 @@ + + 4.0.0 + com.google.api.grpc + proto-google-cloud-valkey-v1beta + 0.0.1-SNAPSHOT + proto-google-cloud-valkey-v1beta + Proto library for google-cloud-valkey + + com.google.cloud + google-cloud-valkey-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-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CertificateAuthority.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CertificateAuthority.java new file mode 100644 index 000000000000..6c60a321f545 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CertificateAuthority.java @@ -0,0 +1,3096 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * A certificate authority for an instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.CertificateAuthority} + */ +public final class CertificateAuthority extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.CertificateAuthority) + CertificateAuthorityOrBuilder { + private static final long serialVersionUID = 0L; + // Use CertificateAuthority.newBuilder() to construct. + private CertificateAuthority(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CertificateAuthority() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CertificateAuthority(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CertificateAuthority.class, + com.google.cloud.memorystore.v1beta.CertificateAuthority.Builder.class); + } + + public interface ManagedCertificateAuthorityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + java.util.List< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + getCaCertsList(); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain + getCaCerts(int index); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + int getCaCertsCount(); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + java.util.List< + ? extends + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + getCaCertsOrBuilderList(); + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder + getCaCertsOrBuilder(int index); + } + /** + * + * + *
+   * A managed certificate authority.
+   * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority} + */ + public static final class ManagedCertificateAuthority + extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + ManagedCertificateAuthorityOrBuilder { + private static final long serialVersionUID = 0L; + // Use ManagedCertificateAuthority.newBuilder() to construct. + private ManagedCertificateAuthority(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ManagedCertificateAuthority() { + caCerts_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ManagedCertificateAuthority(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .class, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .Builder.class); + } + + public interface CertChainOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return A list containing the certificates. + */ + java.util.List getCertificatesList(); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return The count of certificates. + */ + int getCertificatesCount(); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the element to return. + * @return The certificates at the given index. + */ + java.lang.String getCertificates(int index); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the value to return. + * @return The bytes of the certificates at the given index. + */ + com.google.protobuf.ByteString getCertificatesBytes(int index); + } + /** + * + * + *
+     * A certificate chain.
+     * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain} + */ + public static final class CertChain extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain) + CertChainOrBuilder { + private static final long serialVersionUID = 0L; + // Use CertChain.newBuilder() to construct. + private CertChain(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CertChain() { + certificates_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CertChain(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_CertChain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.class, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder.class); + } + + public static final int CERTIFICATES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList certificates_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return A list containing the certificates. + */ + public com.google.protobuf.ProtocolStringList getCertificatesList() { + return certificates_; + } + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @return The count of certificates. + */ + public int getCertificatesCount() { + return certificates_.size(); + } + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the element to return. + * @return The certificates at the given index. + */ + public java.lang.String getCertificates(int index) { + return certificates_.get(index); + } + /** + * + * + *
+       * The certificates that form the CA chain in order of leaf to root.
+       * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the value to return. + * @return The bytes of the certificates at the given index. + */ + public com.google.protobuf.ByteString getCertificatesBytes(int index) { + return certificates_.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 < certificates_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, certificates_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < certificates_.size(); i++) { + dataSize += computeStringSizeNoTag(certificates_.getRaw(i)); + } + size += dataSize; + size += 1 * getCertificatesList().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.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + other = + (com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain) + obj; + + if (!getCertificatesList().equals(other.getCertificatesList())) return false; + if (!getUnknownFields().equals(other.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 (getCertificatesCount() > 0) { + hash = (37 * hash) + CERTIFICATES_FIELD_NUMBER; + hash = (53 * hash) + getCertificatesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 certificate chain.
+       * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain) + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_CertChain_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain.class, + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain.Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + certificates_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + build() { + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + buildPartial() { + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + result = + new com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + certificates_.makeImmutable(); + result.certificates_ = certificates_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain) { + return mergeFrom( + (com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + other) { + if (other + == com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain.getDefaultInstance()) return this; + if (!other.certificates_.isEmpty()) { + if (certificates_.isEmpty()) { + certificates_ = other.certificates_; + bitField0_ |= 0x00000001; + } else { + ensureCertificatesIsMutable(); + certificates_.addAll(other.certificates_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureCertificatesIsMutable(); + certificates_.add(s); + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.LazyStringArrayList certificates_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + + private void ensureCertificatesIsMutable() { + if (!certificates_.isModifiable()) { + certificates_ = new com.google.protobuf.LazyStringArrayList(certificates_); + } + bitField0_ |= 0x00000001; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @return A list containing the certificates. + */ + public com.google.protobuf.ProtocolStringList getCertificatesList() { + certificates_.makeImmutable(); + return certificates_; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @return The count of certificates. + */ + public int getCertificatesCount() { + return certificates_.size(); + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the element to return. + * @return The certificates at the given index. + */ + public java.lang.String getCertificates(int index) { + return certificates_.get(index); + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param index The index of the value to return. + * @return The bytes of the certificates at the given index. + */ + public com.google.protobuf.ByteString getCertificatesBytes(int index) { + return certificates_.getByteString(index); + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param index The index to set the value at. + * @param value The certificates to set. + * @return This builder for chaining. + */ + public Builder setCertificates(int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificatesIsMutable(); + certificates_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param value The certificates to add. + * @return This builder for chaining. + */ + public Builder addCertificates(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureCertificatesIsMutable(); + certificates_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param values The certificates to add. + * @return This builder for chaining. + */ + public Builder addAllCertificates(java.lang.Iterable values) { + ensureCertificatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, certificates_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @return This builder for chaining. + */ + public Builder clearCertificates() { + certificates_ = com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + ; + onChanged(); + return this; + } + /** + * + * + *
+         * The certificates that form the CA chain in order of leaf to root.
+         * 
+ * + * repeated string certificates = 1; + * + * @param value The bytes of the certificates to add. + * @return This builder for chaining. + */ + public Builder addCertificatesBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureCertificatesIsMutable(); + certificates_.add(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.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain) + private static final com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain(); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CertChain parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public static final int CA_CERTS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + caCerts_; + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public java.util.List< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + getCaCertsList() { + return caCerts_; + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public java.util.List< + ? extends + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + getCaCertsOrBuilderList() { + return caCerts_; + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public int getCaCertsCount() { + return caCerts_.size(); + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getCaCerts(int index) { + return caCerts_.get(index); + } + /** + * + * + *
+     * PEM encoded CA certificate chains for managed server authentication.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder + getCaCertsOrBuilder(int index) { + return caCerts_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < caCerts_.size(); i++) { + output.writeMessage(1, caCerts_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < caCerts_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, caCerts_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority other = + (com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + obj; + + if (!getCaCertsList().equals(other.getCaCertsList())) return false; + if (!getUnknownFields().equals(other.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 (getCaCertsCount() > 0) { + hash = (37 * hash) + CA_CERTS_FIELD_NUMBER; + hash = (53 * hash) + getCaCertsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom(com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 managed certificate authority.
+     * 
+ * + * Protobuf type {@code + * google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .class, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (caCertsBuilder_ == null) { + caCerts_ = java.util.Collections.emptyList(); + } else { + caCerts_ = null; + caCertsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + build() { + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + buildPartial() { + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + result = + new com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + result) { + if (caCertsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + caCerts_ = java.util.Collections.unmodifiableList(caCerts_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.caCerts_ = caCerts_; + } else { + result.caCerts_ = caCertsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) { + return mergeFrom( + (com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + other) { + if (other + == com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance()) return this; + if (caCertsBuilder_ == null) { + if (!other.caCerts_.isEmpty()) { + if (caCerts_.isEmpty()) { + caCerts_ = other.caCerts_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureCaCertsIsMutable(); + caCerts_.addAll(other.caCerts_); + } + onChanged(); + } + } else { + if (!other.caCerts_.isEmpty()) { + if (caCertsBuilder_.isEmpty()) { + caCertsBuilder_.dispose(); + caCertsBuilder_ = null; + caCerts_ = other.caCerts_; + bitField0_ = (bitField0_ & ~0x00000001); + caCertsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getCaCertsFieldBuilder() + : null; + } else { + caCertsBuilder_.addAllMessages(other.caCerts_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain + m = + input.readMessage( + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain.parser(), + extensionRegistry); + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(m); + } else { + caCertsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + caCerts_ = java.util.Collections.emptyList(); + + private void ensureCaCertsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + caCerts_ = + new java.util.ArrayList< + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain>(caCerts_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + caCertsBuilder_; + + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public java.util.List< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain> + getCaCertsList() { + if (caCertsBuilder_ == null) { + return java.util.Collections.unmodifiableList(caCerts_); + } else { + return caCertsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public int getCaCertsCount() { + if (caCertsBuilder_ == null) { + return caCerts_.size(); + } else { + return caCertsBuilder_.getCount(); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + getCaCerts(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder setCaCerts( + int index, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.set(index, value); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder setCaCerts( + int index, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.set(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(value); + onChanged(); + } else { + caCertsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + int index, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain + value) { + if (caCertsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureCaCertsIsMutable(); + caCerts_.add(index, value); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addCaCerts( + int index, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + builderForValue) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.add(index, builderForValue.build()); + onChanged(); + } else { + caCertsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder addAllCaCerts( + java.lang.Iterable< + ? extends + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain> + values) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, caCerts_); + onChanged(); + } else { + caCertsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder clearCaCerts() { + if (caCertsBuilder_ == null) { + caCerts_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + caCertsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public Builder removeCaCerts(int index) { + if (caCertsBuilder_ == null) { + ensureCaCertsIsMutable(); + caCerts_.remove(index); + onChanged(); + } else { + caCertsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + getCaCertsBuilder(int index) { + return getCaCertsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder + getCaCertsOrBuilder(int index) { + if (caCertsBuilder_ == null) { + return caCerts_.get(index); + } else { + return caCertsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public java.util.List< + ? extends + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChainOrBuilder> + getCaCertsOrBuilderList() { + if (caCertsBuilder_ != null) { + return caCertsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(caCerts_); + } + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + addCaCertsBuilder() { + return getCaCertsFieldBuilder() + .addBuilder( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.getDefaultInstance()); + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder + addCaCertsBuilder(int index) { + return getCaCertsFieldBuilder() + .addBuilder( + index, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.getDefaultInstance()); + } + /** + * + * + *
+       * PEM encoded CA certificate chains for managed server authentication.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.CertChain ca_certs = 1; + * + */ + public java.util.List< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder> + getCaCertsBuilderList() { + return getCaCertsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChain.Builder, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .CertChainOrBuilder> + getCaCertsFieldBuilder() { + if (caCertsBuilder_ == null) { + caCertsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain, + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChain.Builder, + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.CertChainOrBuilder>( + caCerts_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + caCerts_ = null; + } + return caCertsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + private static final com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority(); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ManagedCertificateAuthority parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int serverCaCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object serverCa_; + + public enum ServerCaCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + MANAGED_SERVER_CA(2), + SERVERCA_NOT_SET(0); + private final int value; + + private ServerCaCase(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 ServerCaCase valueOf(int value) { + return forNumber(value); + } + + public static ServerCaCase forNumber(int value) { + switch (value) { + case 2: + return MANAGED_SERVER_CA; + case 0: + return SERVERCA_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ServerCaCase getServerCaCase() { + return ServerCaCase.forNumber(serverCaCase_); + } + + public static final int MANAGED_SERVER_CA_FIELD_NUMBER = 2; + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return Whether the managedServerCa field is set. + */ + @java.lang.Override + public boolean hasManagedServerCa() { + return serverCaCase_ == 2; + } + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return The managedServerCa. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + getManagedServerCa() { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder + getManagedServerCaOrBuilder() { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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_); + } + if (serverCaCase_ == 2) { + output.writeMessage( + 2, + (com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + serverCa_); + } + 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 (serverCaCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, + (com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority) + serverCa_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.CertificateAuthority)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.CertificateAuthority other = + (com.google.cloud.memorystore.v1beta.CertificateAuthority) obj; + + if (!getName().equals(other.getName())) return false; + if (!getServerCaCase().equals(other.getServerCaCase())) return false; + switch (serverCaCase_) { + case 2: + if (!getManagedServerCa().equals(other.getManagedServerCa())) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + switch (serverCaCase_) { + case 2: + hash = (37 * hash) + MANAGED_SERVER_CA_FIELD_NUMBER; + hash = (53 * hash) + getManagedServerCa().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.CertificateAuthority prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 certificate authority for an instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.CertificateAuthority} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.CertificateAuthority) + com.google.cloud.memorystore.v1beta.CertificateAuthorityOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CertificateAuthority.class, + com.google.cloud.memorystore.v1beta.CertificateAuthority.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.CertificateAuthority.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (managedServerCaBuilder_ != null) { + managedServerCaBuilder_.clear(); + } + name_ = ""; + serverCaCase_ = 0; + serverCa_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.CertificateAuthority.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority build() { + com.google.cloud.memorystore.v1beta.CertificateAuthority result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority buildPartial() { + com.google.cloud.memorystore.v1beta.CertificateAuthority result = + new com.google.cloud.memorystore.v1beta.CertificateAuthority(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.CertificateAuthority result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.name_ = name_; + } + } + + private void buildPartialOneofs( + com.google.cloud.memorystore.v1beta.CertificateAuthority result) { + result.serverCaCase_ = serverCaCase_; + result.serverCa_ = this.serverCa_; + if (serverCaCase_ == 2 && managedServerCaBuilder_ != null) { + result.serverCa_ = managedServerCaBuilder_.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.memorystore.v1beta.CertificateAuthority) { + return mergeFrom((com.google.cloud.memorystore.v1beta.CertificateAuthority) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.CertificateAuthority other) { + if (other == com.google.cloud.memorystore.v1beta.CertificateAuthority.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000002; + onChanged(); + } + switch (other.getServerCaCase()) { + case MANAGED_SERVER_CA: + { + mergeManagedServerCa(other.getManagedServerCa()); + break; + } + case SERVERCA_NOT_SET: + { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + input.readMessage(getManagedServerCaFieldBuilder().getBuilder(), extensionRegistry); + serverCaCase_ = 2; + 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 serverCaCase_ = 0; + private java.lang.Object serverCa_; + + public ServerCaCase getServerCaCase() { + return ServerCaCase.forNumber(serverCaCase_); + } + + public Builder clearServerCa() { + serverCaCase_ = 0; + serverCa_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .Builder, + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder> + managedServerCaBuilder_; + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return Whether the managedServerCa field is set. + */ + @java.lang.Override + public boolean hasManagedServerCa() { + return serverCaCase_ == 2; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return The managedServerCa. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + getManagedServerCa() { + if (managedServerCaBuilder_ == null) { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } else { + if (serverCaCase_ == 2) { + return managedServerCaBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder setManagedServerCa( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + value) { + if (managedServerCaBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + serverCa_ = value; + onChanged(); + } else { + managedServerCaBuilder_.setMessage(value); + } + serverCaCase_ = 2; + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder setManagedServerCa( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority.Builder + builderForValue) { + if (managedServerCaBuilder_ == null) { + serverCa_ = builderForValue.build(); + onChanged(); + } else { + managedServerCaBuilder_.setMessage(builderForValue.build()); + } + serverCaCase_ = 2; + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder mergeManagedServerCa( + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + value) { + if (managedServerCaBuilder_ == null) { + if (serverCaCase_ == 2 + && serverCa_ + != com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority.getDefaultInstance()) { + serverCa_ = + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .newBuilder( + (com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority) + serverCa_) + .mergeFrom(value) + .buildPartial(); + } else { + serverCa_ = value; + } + onChanged(); + } else { + if (serverCaCase_ == 2) { + managedServerCaBuilder_.mergeFrom(value); + } else { + managedServerCaBuilder_.setMessage(value); + } + } + serverCaCase_ = 2; + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public Builder clearManagedServerCa() { + if (managedServerCaBuilder_ == null) { + if (serverCaCase_ == 2) { + serverCaCase_ = 0; + serverCa_ = null; + onChanged(); + } + } else { + if (serverCaCase_ == 2) { + serverCaCase_ = 0; + serverCa_ = null; + } + managedServerCaBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + public com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .Builder + getManagedServerCaBuilder() { + return getManagedServerCaFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder + getManagedServerCaOrBuilder() { + if ((serverCaCase_ == 2) && (managedServerCaBuilder_ != null)) { + return managedServerCaBuilder_.getMessageOrBuilder(); + } else { + if (serverCaCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority) + serverCa_; + } + return com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + } + /** + * + * + *
+     * A managed server certificate authority.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .Builder, + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder> + getManagedServerCaFieldBuilder() { + if (managedServerCaBuilder_ == null) { + if (!(serverCaCase_ == 2)) { + serverCa_ = + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .getDefaultInstance(); + } + managedServerCaBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority, + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + .Builder, + com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthorityOrBuilder>( + (com.google.cloud.memorystore.v1beta.CertificateAuthority + .ManagedCertificateAuthority) + serverCa_, + getParentForChildren(), + isClean()); + serverCa_ = null; + } + serverCaCase_ = 2; + onChanged(); + return managedServerCaBuilder_; + } + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Unique name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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_ |= 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.memorystore.v1beta.CertificateAuthority) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.CertificateAuthority) + private static final com.google.cloud.memorystore.v1beta.CertificateAuthority DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.CertificateAuthority(); + } + + public static com.google.cloud.memorystore.v1beta.CertificateAuthority getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CertificateAuthority parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CertificateAuthority getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CertificateAuthorityOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CertificateAuthorityOrBuilder.java new file mode 100644 index 000000000000..3076f6c1c254 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CertificateAuthorityOrBuilder.java @@ -0,0 +1,100 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface CertificateAuthorityOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.CertificateAuthority) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return Whether the managedServerCa field is set. + */ + boolean hasManagedServerCa(); + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + * + * @return The managedServerCa. + */ + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority + getManagedServerCa(); + /** + * + * + *
+   * A managed server certificate authority.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthority managed_server_ca = 2; + * + */ + com.google.cloud.memorystore.v1beta.CertificateAuthority.ManagedCertificateAuthorityOrBuilder + getManagedServerCaOrBuilder(); + + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Unique name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + com.google.cloud.memorystore.v1beta.CertificateAuthority.ServerCaCase getServerCaCase(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ConnectionType.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ConnectionType.java new file mode 100644 index 000000000000..d5b831601b99 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ConnectionType.java @@ -0,0 +1,199 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Type of a PSC connection
+ * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.ConnectionType} + */ +public enum ConnectionType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * Connection Type is not set
+   * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + CONNECTION_TYPE_UNSPECIFIED(0), + /** + * + * + *
+   * Connection that will be used for topology discovery.
+   * 
+ * + * CONNECTION_TYPE_DISCOVERY = 1; + */ + CONNECTION_TYPE_DISCOVERY(1), + /** + * + * + *
+   * Connection that will be used as primary endpoint to access primary.
+   * 
+ * + * CONNECTION_TYPE_PRIMARY = 2; + */ + CONNECTION_TYPE_PRIMARY(2), + /** + * + * + *
+   * Connection that will be used as reader endpoint to access replicas.
+   * 
+ * + * CONNECTION_TYPE_READER = 3; + */ + CONNECTION_TYPE_READER(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * Connection Type is not set
+   * 
+ * + * CONNECTION_TYPE_UNSPECIFIED = 0; + */ + public static final int CONNECTION_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * Connection that will be used for topology discovery.
+   * 
+ * + * CONNECTION_TYPE_DISCOVERY = 1; + */ + public static final int CONNECTION_TYPE_DISCOVERY_VALUE = 1; + /** + * + * + *
+   * Connection that will be used as primary endpoint to access primary.
+   * 
+ * + * CONNECTION_TYPE_PRIMARY = 2; + */ + public static final int CONNECTION_TYPE_PRIMARY_VALUE = 2; + /** + * + * + *
+   * Connection that will be used as reader endpoint to access replicas.
+   * 
+ * + * CONNECTION_TYPE_READER = 3; + */ + public static final int CONNECTION_TYPE_READER_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ConnectionType 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 ConnectionType forNumber(int value) { + switch (value) { + case 0: + return CONNECTION_TYPE_UNSPECIFIED; + case 1: + return CONNECTION_TYPE_DISCOVERY; + case 2: + return CONNECTION_TYPE_PRIMARY; + case 3: + return CONNECTION_TYPE_READER; + 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 ConnectionType findValueByNumber(int number) { + return ConnectionType.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.memorystore.v1beta.V1mainProto.getDescriptor().getEnumTypes().get(1); + } + + private static final ConnectionType[] VALUES = values(); + + public static ConnectionType 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 ConnectionType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.ConnectionType) +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CreateInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CreateInstanceRequest.java new file mode 100644 index 000000000000..49dbdcaf2df7 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CreateInstanceRequest.java @@ -0,0 +1,1476 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Request message for [CreateInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.CreateInstanceRequest} + */ +public final class CreateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.CreateInstanceRequest) + CreateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CreateInstanceRequest.newBuilder() to construct. + private CreateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private CreateInstanceRequest() { + parent_ = ""; + instanceId_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new CreateInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CreateInstanceRequest.class, + com.google.cloud.memorystore.v1beta.CreateInstanceRequest.Builder.class); + } + + private int bitField0_; + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object instanceId_ = ""; + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + @java.lang.Override + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int INSTANCE_FIELD_NUMBER = 3; + private com.google.cloud.memorystore.v1beta.Instance instance_; + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance getInstance() { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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(instanceId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, instanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(3, getInstance()); + } + 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(instanceId_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, instanceId_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getInstance()); + } + 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.memorystore.v1beta.CreateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.CreateInstanceRequest other = + (com.google.cloud.memorystore.v1beta.CreateInstanceRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (!getInstanceId().equals(other.getInstanceId())) return false; + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.CreateInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [CreateInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.CreateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.CreateInstanceRequest) + com.google.cloud.memorystore.v1beta.CreateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CreateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.CreateInstanceRequest.class, + com.google.cloud.memorystore.v1beta.CreateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.CreateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getInstanceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + instanceId_ = ""; + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_CreateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CreateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.CreateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CreateInstanceRequest build() { + com.google.cloud.memorystore.v1beta.CreateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CreateInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1beta.CreateInstanceRequest result = + new com.google.cloud.memorystore.v1beta.CreateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.CreateInstanceRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instanceId_ = instanceId_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.requestId_ = requestId_; + } + 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.memorystore.v1beta.CreateInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1beta.CreateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.CreateInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1beta.CreateInstanceRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000008; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + instanceId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent resource where this instance will be created.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + public com.google.protobuf.ByteString getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearInstanceId() { + instanceId_ = getDefaultInstance().getInstanceId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The ID to use for the instance, which will become the final
+     * component of the instance's resource name.
+     *
+     * This value is subject to the following restrictions:
+     *
+     * * Must be 4-63 characters in length
+     * * Must begin with a letter or digit
+     * * Must contain only lowercase letters, digits, and hyphens
+     * * Must not end with a hyphen
+     * * Must be unique within a location
+     * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @param value The bytes for instanceId to set. + * @return This builder for chaining. + */ + public Builder setInstanceIdBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + instanceId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1beta.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.memorystore.v1beta.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.memorystore.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance( + com.google.cloud.memorystore.v1beta.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.memorystore.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && instance_ != null + && instance_ != com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + if (instance_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000004); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The instance to create.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1beta.CreateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.CreateInstanceRequest) + private static final com.google.cloud.memorystore.v1beta.CreateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.CreateInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1beta.CreateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CreateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.CreateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CreateInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CreateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..2ddde5e7c6e9 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/CreateInstanceRequestOrBuilder.java @@ -0,0 +1,194 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface CreateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.CreateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent resource where this instance will be created.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The instanceId. + */ + java.lang.String getInstanceId(); + /** + * + * + *
+   * Required. The ID to use for the instance, which will become the final
+   * component of the instance's resource name.
+   *
+   * This value is subject to the following restrictions:
+   *
+   * * Must be 4-63 characters in length
+   * * Must begin with a letter or digit
+   * * Must contain only lowercase letters, digits, and hyphens
+   * * Must not end with a hyphen
+   * * Must be unique within a location
+   * 
+ * + * string instance_id = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for instanceId. + */ + com.google.protobuf.ByteString getInstanceIdBytes(); + + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.memorystore.v1beta.Instance getInstance(); + /** + * + * + *
+   * Required. The instance to create.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 3 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DeleteInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DeleteInstanceRequest.java new file mode 100644 index 000000000000..4225e74cf885 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DeleteInstanceRequest.java @@ -0,0 +1,927 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Request message for [DeleteInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.DeleteInstanceRequest} + */ +public final class DeleteInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.DeleteInstanceRequest) + DeleteInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteInstanceRequest.newBuilder() to construct. + private DeleteInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private DeleteInstanceRequest() { + name_ = ""; + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new DeleteInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest.class, + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1beta.DeleteInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest other = + (com.google.cloud.memorystore.v1beta.DeleteInstanceRequest) 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.memorystore.v1beta.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [DeleteInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.DeleteInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.DeleteInstanceRequest) + com.google.cloud.memorystore.v1beta.DeleteInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DeleteInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest.class, + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.DeleteInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DeleteInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DeleteInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.DeleteInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DeleteInstanceRequest build() { + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DeleteInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1beta.DeleteInstanceRequest result = + new com.google.cloud.memorystore.v1beta.DeleteInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.DeleteInstanceRequest 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.memorystore.v1beta.DeleteInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1beta.DeleteInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.DeleteInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1beta.DeleteInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to delete.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes after the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1beta.DeleteInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.DeleteInstanceRequest) + private static final com.google.cloud.memorystore.v1beta.DeleteInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.DeleteInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1beta.DeleteInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DeleteInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DeleteInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DeleteInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..094568a6b05a --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DeleteInstanceRequestOrBuilder.java @@ -0,0 +1,110 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface DeleteInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.DeleteInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the instance to delete.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes after the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DiscoveryEndpoint.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DiscoveryEndpoint.java new file mode 100644 index 000000000000..ddfbc8ea51c2 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DiscoveryEndpoint.java @@ -0,0 +1,929 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Represents an endpoint for clients to connect to the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.DiscoveryEndpoint} + */ +public final class DiscoveryEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.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_ = ""; + network_ = ""; + } + + @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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.class, + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder.class); + } + + public static final int ADDRESS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object address_ = ""; + /** + * + * + *
+   * Output only. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * 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 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 NETWORK_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object network_ = ""; + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, 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(address_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, address_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, port_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(network_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, 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.memorystore.v1beta.DiscoveryEndpoint)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint other = + (com.google.cloud.memorystore.v1beta.DiscoveryEndpoint) obj; + + if (!getAddress().equals(other.getAddress())) return false; + if (getPort() != other.getPort()) 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) + ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getAddress().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + 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.memorystore.v1beta.DiscoveryEndpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.DiscoveryEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.DiscoveryEndpoint parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.DiscoveryEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.DiscoveryEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.DiscoveryEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.DiscoveryEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.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; + } + /** + * + * + *
+   * Represents an endpoint for clients to connect to the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.DiscoveryEndpoint} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.DiscoveryEndpoint) + com.google.cloud.memorystore.v1beta.DiscoveryEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DiscoveryEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.class, + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.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; + network_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_DiscoveryEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint build() { + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint buildPartial() { + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint result = + new com.google.cloud.memorystore.v1beta.DiscoveryEndpoint(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.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.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.memorystore.v1beta.DiscoveryEndpoint) { + return mergeFrom((com.google.cloud.memorystore.v1beta.DiscoveryEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.DiscoveryEndpoint other) { + if (other == com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.getDefaultInstance()) + return this; + if (!other.getAddress().isEmpty()) { + address_ = other.address_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + 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: + { + address_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + port_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 34: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 34 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object address_ = ""; + /** + * + * + *
+     * Output only. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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. IP address of the exposed endpoint clients connect to.
+     * 
+ * + * 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 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 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 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 java.lang.Object network_ = ""; + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 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.memorystore.v1beta.DiscoveryEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.DiscoveryEndpoint) + private static final com.google.cloud.memorystore.v1beta.DiscoveryEndpoint DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.DiscoveryEndpoint(); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.DiscoveryEndpoint getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DiscoveryEndpointOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DiscoveryEndpointOrBuilder.java new file mode 100644 index 000000000000..45b7c613aabb --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/DiscoveryEndpointOrBuilder.java @@ -0,0 +1,97 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface DiscoveryEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.DiscoveryEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * string address = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The address. + */ + java.lang.String getAddress(); + /** + * + * + *
+   * Output only. IP address of the exposed endpoint clients connect to.
+   * 
+ * + * 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 endpoint.
+   * 
+ * + * int32 port = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The port. + */ + int getPort(); + + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Output only. 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 = 4 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetCertificateAuthorityRequest.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetCertificateAuthorityRequest.java new file mode 100644 index 000000000000..08cacf881b36 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetCertificateAuthorityRequest.java @@ -0,0 +1,666 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Request message for [GetCertificateAuthority][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest} + */ +public final class GetCertificateAuthorityRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest) + GetCertificateAuthorityRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetCertificateAuthorityRequest.newBuilder() to construct. + private GetCertificateAuthorityRequest( + com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetCertificateAuthorityRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetCertificateAuthorityRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetCertificateAuthorityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetCertificateAuthorityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest.class, + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * 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.memorystore.v1beta.GetCertificateAuthorityRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest other = + (com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest) 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.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [GetCertificateAuthority][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest) + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetCertificateAuthorityRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetCertificateAuthorityRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest.class, + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest.Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest.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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetCertificateAuthorityRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest build() { + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest buildPartial() { + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest result = + new com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest 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.memorystore.v1beta.GetCertificateAuthorityRequest) { + return mergeFrom( + (com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest other) { + if (other + == com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + .getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the certificate authority.
+     * Format:
+     * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+     * 
+ * + * + * 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.memorystore.v1beta.GetCertificateAuthorityRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest) + private static final com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest(); + } + + public static com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetCertificateAuthorityRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetCertificateAuthorityRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetCertificateAuthorityRequestOrBuilder.java new file mode 100644 index 000000000000..bedf559b4b9c --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetCertificateAuthorityRequestOrBuilder.java @@ -0,0 +1,59 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface GetCertificateAuthorityRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the certificate authority.
+   * Format:
+   * projects/{project}/locations/{location}/instances/{instance}/certificateAuthority
+   * 
+ * + * + * 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-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetInstanceRequest.java new file mode 100644 index 000000000000..617aaa66609b --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetInstanceRequest.java @@ -0,0 +1,647 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Request message for [GetInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.GetInstanceRequest} + */ +public final class GetInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.GetInstanceRequest) + GetInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetInstanceRequest.newBuilder() to construct. + private GetInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private GetInstanceRequest() { + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new GetInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.GetInstanceRequest.class, + com.google.cloud.memorystore.v1beta.GetInstanceRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * 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.memorystore.v1beta.GetInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.GetInstanceRequest other = + (com.google.cloud.memorystore.v1beta.GetInstanceRequest) 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.memorystore.v1beta.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.GetInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [GetInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.GetInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.GetInstanceRequest) + com.google.cloud.memorystore.v1beta.GetInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.GetInstanceRequest.class, + com.google.cloud.memorystore.v1beta.GetInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.GetInstanceRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_GetInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.GetInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetInstanceRequest build() { + com.google.cloud.memorystore.v1beta.GetInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1beta.GetInstanceRequest result = + new com.google.cloud.memorystore.v1beta.GetInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.GetInstanceRequest 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.memorystore.v1beta.GetInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1beta.GetInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.GetInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1beta.GetInstanceRequest.getDefaultInstance()) + return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + name_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for name. + */ + public com.google.protobuf.ByteString getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + name_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The name of the instance to retrieve.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * + * 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.memorystore.v1beta.GetInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.GetInstanceRequest) + private static final com.google.cloud.memorystore.v1beta.GetInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.GetInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1beta.GetInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.GetInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..e141254c930b --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/GetInstanceRequestOrBuilder.java @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface GetInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.GetInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * string name = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Required. The name of the instance to retrieve.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * + * 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-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/Instance.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/Instance.java new file mode 100644 index 000000000000..5b0bb4e6af4a --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/Instance.java @@ -0,0 +1,11279 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * A Memorystore instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance} + */ +public final class Instance extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.Instance) + InstanceOrBuilder { + private static final long serialVersionUID = 0L; + // Use Instance.newBuilder() to construct. + private Instance(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private Instance() { + name_ = ""; + state_ = 0; + uid_ = ""; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + discoveryEndpoints_ = java.util.Collections.emptyList(); + nodeType_ = 0; + engineVersion_ = ""; + pscAutoConnections_ = java.util.Collections.emptyList(); + endpoints_ = java.util.Collections.emptyList(); + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new Instance(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetLabels(); + case 16: + return internalGetEngineConfigs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.class, + com.google.cloud.memorystore.v1beta.Instance.Builder.class); + } + + /** + * + * + *
+   * Possible states of the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.Instance.State} + */ + public enum State implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + STATE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is being created.
+     * 
+ * + * CREATING = 1; + */ + CREATING(1), + /** + * + * + *
+     * Instance has been created and is usable.
+     * 
+ * + * ACTIVE = 2; + */ + ACTIVE(2), + /** + * + * + *
+     * Instance is being updated.
+     * 
+ * + * UPDATING = 3; + */ + UPDATING(3), + /** + * + * + *
+     * Instance is being deleted.
+     * 
+ * + * DELETING = 4; + */ + DELETING(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * STATE_UNSPECIFIED = 0; + */ + public static final int STATE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance is being created.
+     * 
+ * + * CREATING = 1; + */ + public static final int CREATING_VALUE = 1; + /** + * + * + *
+     * Instance has been created and is usable.
+     * 
+ * + * ACTIVE = 2; + */ + public static final int ACTIVE_VALUE = 2; + /** + * + * + *
+     * Instance is being updated.
+     * 
+ * + * UPDATING = 3; + */ + public static final int UPDATING_VALUE = 3; + /** + * + * + *
+     * Instance 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.memorystore.v1beta.Instance.getDescriptor().getEnumTypes().get(0); + } + + private static final State[] VALUES = values(); + + public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private State(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.Instance.State) + } + + /** + * + * + *
+   * Possible authorization modes of the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.Instance.AuthorizationMode} + */ + public enum AuthorizationMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * AUTHORIZATION_MODE_UNSPECIFIED = 0; + */ + AUTHORIZATION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Authorization disabled.
+     * 
+ * + * AUTH_DISABLED = 1; + */ + AUTH_DISABLED(1), + /** + * + * + *
+     * IAM basic authorization.
+     * 
+ * + * IAM_AUTH = 2; + */ + IAM_AUTH(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * AUTHORIZATION_MODE_UNSPECIFIED = 0; + */ + public static final int AUTHORIZATION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Authorization disabled.
+     * 
+ * + * AUTH_DISABLED = 1; + */ + public static final int AUTH_DISABLED_VALUE = 1; + /** + * + * + *
+     * IAM basic authorization.
+     * 
+ * + * IAM_AUTH = 2; + */ + public static final int IAM_AUTH_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 AUTHORIZATION_MODE_UNSPECIFIED; + case 1: + return AUTH_DISABLED; + case 2: + return IAM_AUTH; + 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.memorystore.v1beta.Instance.getDescriptor().getEnumTypes().get(1); + } + + 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.memorystore.v1beta.Instance.AuthorizationMode) + } + + /** + * + * + *
+   * Possible in-transit encryption modes of the instance.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode} + */ + public enum TransitEncryptionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * In-transit encryption is disabled.
+     * 
+ * + * TRANSIT_ENCRYPTION_DISABLED = 1; + */ + TRANSIT_ENCRYPTION_DISABLED(1), + /** + * + * + *
+     * Server-managed encryption is used for in-transit encryption.
+     * 
+ * + * SERVER_AUTHENTICATION = 2; + */ + SERVER_AUTHENTICATION(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + */ + public static final int TRANSIT_ENCRYPTION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * In-transit encryption is disabled.
+     * 
+ * + * TRANSIT_ENCRYPTION_DISABLED = 1; + */ + public static final int TRANSIT_ENCRYPTION_DISABLED_VALUE = 1; + /** + * + * + *
+     * Server-managed encryption is used for in-transit encryption.
+     * 
+ * + * SERVER_AUTHENTICATION = 2; + */ + public static final int 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_DISABLED; + case 2: + return 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.memorystore.v1beta.Instance.getDescriptor().getEnumTypes().get(2); + } + + 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.memorystore.v1beta.Instance.TransitEncryptionMode) + } + + /** + * + * + *
+   * Possible node types of the instance. See
+   * https://cloud.google.com/memorystore/docs/valkey/instance-node-specification
+   * for more information.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.Instance.NodeType} + */ + public enum NodeType implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * NODE_TYPE_UNSPECIFIED = 0; + */ + NODE_TYPE_UNSPECIFIED(0), + /** + * + * + *
+     * Shared core nano.
+     * 
+ * + * SHARED_CORE_NANO = 1; + */ + SHARED_CORE_NANO(1), + /** + * + * + *
+     * High memory medium.
+     * 
+ * + * HIGHMEM_MEDIUM = 2; + */ + HIGHMEM_MEDIUM(2), + /** + * + * + *
+     * High memory extra large.
+     * 
+ * + * HIGHMEM_XLARGE = 3; + */ + HIGHMEM_XLARGE(3), + /** + * + * + *
+     * Standard small.
+     * 
+ * + * STANDARD_SMALL = 4; + */ + STANDARD_SMALL(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * NODE_TYPE_UNSPECIFIED = 0; + */ + public static final int NODE_TYPE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Shared core nano.
+     * 
+ * + * SHARED_CORE_NANO = 1; + */ + public static final int SHARED_CORE_NANO_VALUE = 1; + /** + * + * + *
+     * High memory medium.
+     * 
+ * + * HIGHMEM_MEDIUM = 2; + */ + public static final int HIGHMEM_MEDIUM_VALUE = 2; + /** + * + * + *
+     * High memory extra large.
+     * 
+ * + * HIGHMEM_XLARGE = 3; + */ + public static final int HIGHMEM_XLARGE_VALUE = 3; + /** + * + * + *
+     * Standard small.
+     * 
+ * + * STANDARD_SMALL = 4; + */ + public static final int STANDARD_SMALL_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 NodeType 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 NodeType forNumber(int value) { + switch (value) { + case 0: + return NODE_TYPE_UNSPECIFIED; + case 1: + return SHARED_CORE_NANO; + case 2: + return HIGHMEM_MEDIUM; + case 3: + return HIGHMEM_XLARGE; + case 4: + return STANDARD_SMALL; + 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 NodeType findValueByNumber(int number) { + return NodeType.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.memorystore.v1beta.Instance.getDescriptor().getEnumTypes().get(3); + } + + private static final NodeType[] VALUES = values(); + + public static NodeType 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 NodeType(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.Instance.NodeType) + } + + /** + * + * + *
+   * The mode config, which is used to enable/disable cluster mode.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.Instance.Mode} + */ + public enum Mode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Mode is not specified.
+     * 
+ * + * MODE_UNSPECIFIED = 0; + */ + MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Instance is in standalone mode.
+     * 
+ * + * STANDALONE = 1; + */ + STANDALONE(1), + /** + * + * + *
+     * Instance is in cluster mode.
+     * 
+ * + * CLUSTER = 2; + */ + CLUSTER(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Mode is not specified.
+     * 
+ * + * MODE_UNSPECIFIED = 0; + */ + public static final int MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Instance is in standalone mode.
+     * 
+ * + * STANDALONE = 1; + */ + public static final int STANDALONE_VALUE = 1; + /** + * + * + *
+     * Instance is in cluster mode.
+     * 
+ * + * CLUSTER = 2; + */ + public static final int CLUSTER_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 Mode 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 Mode forNumber(int value) { + switch (value) { + case 0: + return MODE_UNSPECIFIED; + case 1: + return STANDALONE; + case 2: + return CLUSTER; + 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 Mode findValueByNumber(int number) { + return Mode.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.memorystore.v1beta.Instance.getDescriptor().getEnumTypes().get(4); + } + + private static final Mode[] VALUES = values(); + + public static Mode 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 Mode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.Instance.Mode) + } + + public interface StateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.Instance.StateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateInfo field is set. + */ + boolean hasUpdateInfo(); + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateInfo. + */ + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo getUpdateInfo(); + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder(); + + com.google.cloud.memorystore.v1beta.Instance.StateInfo.InfoCase getInfoCase(); + } + /** + * + * + *
+   * Additional information about the state of the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.StateInfo} + */ + public static final class StateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.class, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.Builder.class); + } + + public interface UpdateInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetShardCount field is set. + */ + boolean hasTargetShardCount(); + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetShardCount. + */ + int getTargetShardCount(); + + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetReplicaCount field is set. + */ + boolean hasTargetReplicaCount(); + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetReplicaCount. + */ + int getTargetReplicaCount(); + } + /** + * + * + *
+     * Represents information about instance with state UPDATING.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo} + */ + public static final class UpdateInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.class, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.Builder.class); + } + + private int bitField0_; + public static final int TARGET_SHARD_COUNT_FIELD_NUMBER = 1; + private int targetShardCount_ = 0; + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+       * Output only. Target number of shards for the instance.
+       * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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; + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Output only. Target number of replica nodes per shard for the instance.
+       * 
+ * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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.memorystore.v1beta.Instance.StateInfo.UpdateInfo)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo other = + (com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo.UpdateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo.UpdateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo.UpdateInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo.UpdateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo.UpdateInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.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 instance with state UPDATING.
+       * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_UpdateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.class, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_UpdateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + .getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo build() { + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo buildPartial() { + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo result = + new com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo.UpdateInfo) { + return mergeFrom( + (com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo other) { + if (other + == com.google.cloud.memorystore.v1beta.Instance.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_; + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetShardCount field is set. + */ + @java.lang.Override + public boolean hasTargetShardCount() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetShardCount. + */ + @java.lang.Override + public int getTargetShardCount() { + return targetShardCount_; + } + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The targetShardCount to set. + * @return This builder for chaining. + */ + public Builder setTargetShardCount(int value) { + + targetShardCount_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. Target number of shards for the instance.
+         * 
+ * + * optional int32 target_shard_count = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearTargetShardCount() { + bitField0_ = (bitField0_ & ~0x00000001); + targetShardCount_ = 0; + onChanged(); + return this; + } + + private int targetReplicaCount_; + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the targetReplicaCount field is set. + */ + @java.lang.Override + public boolean hasTargetReplicaCount() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The targetReplicaCount. + */ + @java.lang.Override + public int getTargetReplicaCount() { + return targetReplicaCount_; + } + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The targetReplicaCount to set. + * @return This builder for chaining. + */ + public Builder setTargetReplicaCount(int value) { + + targetReplicaCount_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+         * Output only. Target number of replica nodes per shard for the instance.
+         * 
+ * + * + * optional int32 target_replica_count = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @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.memorystore.v1beta.Instance.StateInfo.UpdateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) + private static final com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo(); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.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; + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo getUpdateInfo() { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.getDefaultInstance(); + } + /** + * + * + *
+     * Output only. Describes ongoing update when instance state is UPDATING.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.Instance.StateInfo other = + (com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.StateInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.StateInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.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; + } + /** + * + * + *
+     * Additional information about the state of the instance.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.StateInfo} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.Instance.StateInfo) + com.google.cloud.memorystore.v1beta.Instance.StateInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.class, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.Instance.StateInfo.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo build() { + com.google.cloud.memorystore.v1beta.Instance.StateInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo buildPartial() { + com.google.cloud.memorystore.v1beta.Instance.StateInfo result = + new com.google.cloud.memorystore.v1beta.Instance.StateInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.Instance.StateInfo result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo) { + return mergeFrom((com.google.cloud.memorystore.v1beta.Instance.StateInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.Instance.StateInfo other) { + if (other == com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo.UpdateInfo, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.Builder, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoOrBuilder> + updateInfoBuilder_; + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateInfo field is set. + */ + @java.lang.Override + public boolean hasUpdateInfo() { + return infoCase_ == 1; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateInfo. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo getUpdateInfo() { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + .getDefaultInstance(); + } else { + if (infoCase_ == 1) { + return updateInfoBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateInfo( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + info_ = value; + onChanged(); + } else { + updateInfoBuilder_.setMessage(value); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateInfo( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.Builder + builderForValue) { + if (updateInfoBuilder_ == null) { + info_ = builderForValue.build(); + onChanged(); + } else { + updateInfoBuilder_.setMessage(builderForValue.build()); + } + infoCase_ = 1; + return this; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateInfo( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo value) { + if (updateInfoBuilder_ == null) { + if (infoCase_ == 1 + && info_ + != com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + .getDefaultInstance()) { + info_ = + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.newBuilder( + (com.google.cloud.memorystore.v1beta.Instance.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; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + 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; + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.Builder + getUpdateInfoBuilder() { + return getUpdateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoOrBuilder + getUpdateInfoOrBuilder() { + if ((infoCase_ == 1) && (updateInfoBuilder_ != null)) { + return updateInfoBuilder_.getMessageOrBuilder(); + } else { + if (infoCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo) info_; + } + return com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + .getDefaultInstance(); + } + } + /** + * + * + *
+       * Output only. Describes ongoing update when instance state is UPDATING.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo update_info = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.Builder, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoOrBuilder> + getUpdateInfoFieldBuilder() { + if (updateInfoBuilder_ == null) { + if (!(infoCase_ == 1)) { + info_ = + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo + .getDefaultInstance(); + } + updateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfo.Builder, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.UpdateInfoOrBuilder>( + (com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.Instance.StateInfo) + private static final com.google.cloud.memorystore.v1beta.Instance.StateInfo DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.Instance.StateInfo(); + } + + public static com.google.cloud.memorystore.v1beta.Instance.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.memorystore.v1beta.Instance.StateInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface InstanceEndpointOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getConnectionsList(); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail getConnections(int index); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getConnectionsCount(); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getConnectionsOrBuilderList(); + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder getConnectionsOrBuilder( + int index); + } + /** + * + * + *
+   * InstanceEndpoint consists of PSC connections that are created
+   * as a group in each VPC network for accessing the instance. In each group,
+   * there shall be one connection for each service attachment in the cluster.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.InstanceEndpoint} + */ + public static final class InstanceEndpoint extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) + InstanceEndpointOrBuilder { + private static final long serialVersionUID = 0L; + // Use InstanceEndpoint.newBuilder() to construct. + private InstanceEndpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private InstanceEndpoint() { + connections_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new InstanceEndpoint(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_InstanceEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_InstanceEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.class, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder.class); + } + + public static final int CONNECTIONS_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List + connections_; + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getConnectionsList() { + return connections_; + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder> + getConnectionsOrBuilderList() { + return connections_; + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getConnectionsCount() { + return connections_.size(); + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail getConnections(int index) { + return connections_.get(index); + } + /** + * + * + *
+     * Optional. A group of PSC connections. They are created in the same VPC
+     * network, one for each service attachment in the cluster.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder + getConnectionsOrBuilder(int index) { + return connections_.get(index); + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < connections_.size(); i++) { + output.writeMessage(1, connections_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < connections_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, connections_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint other = + (com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) obj; + + if (!getConnectionsList().equals(other.getConnectionsList())) return false; + if (!getUnknownFields().equals(other.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 (getConnectionsCount() > 0) { + hash = (37 * hash) + CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getConnectionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * InstanceEndpoint consists of PSC connections that are created
+     * as a group in each VPC network for accessing the instance. In each group,
+     * there shall be one connection for each service attachment in the cluster.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.InstanceEndpoint} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_InstanceEndpoint_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_InstanceEndpoint_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.class, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + } else { + connections_ = null; + connectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_InstanceEndpoint_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint build() { + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint buildPartial() { + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint result = + new com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint result) { + if (connectionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + connections_ = java.util.Collections.unmodifiableList(connections_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.connections_ = connections_; + } else { + result.connections_ = connectionsBuilder_.build(); + } + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) { + return mergeFrom((com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint other) { + if (other + == com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.getDefaultInstance()) + return this; + if (connectionsBuilder_ == null) { + if (!other.connections_.isEmpty()) { + if (connections_.isEmpty()) { + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureConnectionsIsMutable(); + connections_.addAll(other.connections_); + } + onChanged(); + } + } else { + if (!other.connections_.isEmpty()) { + if (connectionsBuilder_.isEmpty()) { + connectionsBuilder_.dispose(); + connectionsBuilder_ = null; + connections_ = other.connections_; + bitField0_ = (bitField0_ & ~0x00000001); + connectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getConnectionsFieldBuilder() + : null; + } else { + connectionsBuilder_.addAllMessages(other.connections_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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.memorystore.v1beta.Instance.ConnectionDetail m = + input.readMessage( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.parser(), + extensionRegistry); + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(m); + } else { + connectionsBuilder_.addMessage(m); + } + break; + } // case 10 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + connections_ = java.util.Collections.emptyList(); + + private void ensureConnectionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + connections_ = + new java.util.ArrayList< + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail>(connections_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder> + connectionsBuilder_; + + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getConnectionsList() { + if (connectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(connections_); + } else { + return connectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getConnectionsCount() { + if (connectionsBuilder_ == null) { + return connections_.size(); + } else { + return connectionsBuilder_.getCount(); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail getConnections( + int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnections( + int index, com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.set(index, value); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setConnections( + int index, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.set(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(value); + onChanged(); + } else { + connectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + int index, com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail value) { + if (connectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureConnectionsIsMutable(); + connections_.add(index, value); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addConnections( + int index, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder builderForValue) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.add(index, builderForValue.build()); + onChanged(); + } else { + connectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllConnections( + java.lang.Iterable< + ? extends com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail> + values) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, connections_); + onChanged(); + } else { + connectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearConnections() { + if (connectionsBuilder_ == null) { + connections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + connectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeConnections(int index) { + if (connectionsBuilder_ == null) { + ensureConnectionsIsMutable(); + connections_.remove(index); + onChanged(); + } else { + connectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder + getConnectionsBuilder(int index) { + return getConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder + getConnectionsOrBuilder(int index) { + if (connectionsBuilder_ == null) { + return connections_.get(index); + } else { + return connectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder> + getConnectionsOrBuilderList() { + if (connectionsBuilder_ != null) { + return connectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(connections_); + } + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder + addConnectionsBuilder() { + return getConnectionsFieldBuilder() + .addBuilder( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.getDefaultInstance()); + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder + addConnectionsBuilder(int index) { + return getConnectionsFieldBuilder() + .addBuilder( + index, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.getDefaultInstance()); + } + /** + * + * + *
+       * Optional. A group of PSC connections. They are created in the same VPC
+       * network, one for each service attachment in the cluster.
+       * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.ConnectionDetail connections = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getConnectionsBuilderList() { + return getConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder> + getConnectionsFieldBuilder() { + if (connectionsBuilder_ == null) { + connectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder>( + connections_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + connections_ = null; + } + return connectionsBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.Instance.InstanceEndpoint) + private static final com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint(); + } + + public static com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InstanceEndpoint parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionDetailOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.Instance.ConnectionDetail) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + * + * @return Whether the pscAutoConnection field is set. + */ + boolean hasPscAutoConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + * + * @return The pscAutoConnection. + */ + com.google.cloud.memorystore.v1beta.PscAutoConnection getPscAutoConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder getPscAutoConnectionOrBuilder(); + + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + * + * @return Whether the pscConnection field is set. + */ + boolean hasPscConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + * + * @return The pscConnection. + */ + com.google.cloud.memorystore.v1beta.PscConnection getPscConnection(); + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + com.google.cloud.memorystore.v1beta.PscConnectionOrBuilder getPscConnectionOrBuilder(); + + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.ConnectionCase + getConnectionCase(); + } + /** + * + * + *
+   * Information of each PSC connection.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.ConnectionDetail} + */ + public static final class ConnectionDetail extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.Instance.ConnectionDetail) + ConnectionDetailOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConnectionDetail.newBuilder() to construct. + private ConnectionDetail(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionDetail() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionDetail(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_ConnectionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_ConnectionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.class, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder.class); + } + + private int connectionCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object connection_; + + public enum ConnectionCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PSC_AUTO_CONNECTION(1), + PSC_CONNECTION(2), + CONNECTION_NOT_SET(0); + private final int value; + + private ConnectionCase(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 ConnectionCase valueOf(int value) { + return forNumber(value); + } + + public static ConnectionCase forNumber(int value) { + switch (value) { + case 1: + return PSC_AUTO_CONNECTION; + case 2: + return PSC_CONNECTION; + case 0: + return CONNECTION_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public ConnectionCase getConnectionCase() { + return ConnectionCase.forNumber(connectionCase_); + } + + public static final int PSC_AUTO_CONNECTION_FIELD_NUMBER = 1; + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + * + * @return Whether the pscAutoConnection field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnection() { + return connectionCase_ == 1; + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + * + * @return The pscAutoConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnection getPscAutoConnection() { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance(); + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created through
+     * service connectivity automation.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder + getPscAutoConnectionOrBuilder() { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance(); + } + + public static final int PSC_CONNECTION_FIELD_NUMBER = 2; + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + * + * @return Whether the pscConnection field is set. + */ + @java.lang.Override + public boolean hasPscConnection() { + return connectionCase_ == 2; + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + * + * @return The pscConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnection getPscConnection() { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance(); + } + /** + * + * + *
+     * Detailed information of a PSC connection that is created by the user.
+     * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnectionOrBuilder getPscConnectionOrBuilder() { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscConnection.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 (connectionCase_ == 1) { + output.writeMessage(1, (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_); + } + if (connectionCase_ == 2) { + output.writeMessage(2, (com.google.cloud.memorystore.v1beta.PscConnection) connection_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (connectionCase_ == 1) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 1, (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_); + } + if (connectionCase_ == 2) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 2, (com.google.cloud.memorystore.v1beta.PscConnection) connection_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail other = + (com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail) obj; + + if (!getConnectionCase().equals(other.getConnectionCase())) return false; + switch (connectionCase_) { + case 1: + if (!getPscAutoConnection().equals(other.getPscAutoConnection())) return false; + break; + case 2: + if (!getPscConnection().equals(other.getPscConnection())) 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 (connectionCase_) { + case 1: + hash = (37 * hash) + PSC_AUTO_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnection().hashCode(); + break; + case 2: + hash = (37 * hash) + PSC_CONNECTION_FIELD_NUMBER; + hash = (53 * hash) + getPscConnection().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Information of each PSC connection.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance.ConnectionDetail} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.Instance.ConnectionDetail) + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetailOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_ConnectionDetail_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_ConnectionDetail_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.class, + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (pscAutoConnectionBuilder_ != null) { + pscAutoConnectionBuilder_.clear(); + } + if (pscConnectionBuilder_ != null) { + pscConnectionBuilder_.clear(); + } + connectionCase_ = 0; + connection_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_ConnectionDetail_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail build() { + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail buildPartial() { + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail result = + new com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail result) { + result.connectionCase_ = connectionCase_; + result.connection_ = this.connection_; + if (connectionCase_ == 1 && pscAutoConnectionBuilder_ != null) { + result.connection_ = pscAutoConnectionBuilder_.build(); + } + if (connectionCase_ == 2 && pscConnectionBuilder_ != null) { + result.connection_ = pscConnectionBuilder_.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.memorystore.v1beta.Instance.ConnectionDetail) { + return mergeFrom((com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail other) { + if (other + == com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail.getDefaultInstance()) + return this; + switch (other.getConnectionCase()) { + case PSC_AUTO_CONNECTION: + { + mergePscAutoConnection(other.getPscAutoConnection()); + break; + } + case PSC_CONNECTION: + { + mergePscConnection(other.getPscConnection()); + break; + } + case CONNECTION_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( + getPscAutoConnectionFieldBuilder().getBuilder(), extensionRegistry); + connectionCase_ = 1; + break; + } // case 10 + case 18: + { + input.readMessage(getPscConnectionFieldBuilder().getBuilder(), extensionRegistry); + connectionCase_ = 2; + 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 connectionCase_ = 0; + private java.lang.Object connection_; + + public ConnectionCase getConnectionCase() { + return ConnectionCase.forNumber(connectionCase_); + } + + public Builder clearConnection() { + connectionCase_ = 0; + connection_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscAutoConnection, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder> + pscAutoConnectionBuilder_; + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + * + * @return Whether the pscAutoConnection field is set. + */ + @java.lang.Override + public boolean hasPscAutoConnection() { + return connectionCase_ == 1; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + * + * @return The pscAutoConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnection getPscAutoConnection() { + if (pscAutoConnectionBuilder_ == null) { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance(); + } else { + if (connectionCase_ == 1) { + return pscAutoConnectionBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + public Builder setPscAutoConnection( + com.google.cloud.memorystore.v1beta.PscAutoConnection value) { + if (pscAutoConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + pscAutoConnectionBuilder_.setMessage(value); + } + connectionCase_ = 1; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + public Builder setPscAutoConnection( + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + pscAutoConnectionBuilder_.setMessage(builderForValue.build()); + } + connectionCase_ = 1; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + public Builder mergePscAutoConnection( + com.google.cloud.memorystore.v1beta.PscAutoConnection value) { + if (pscAutoConnectionBuilder_ == null) { + if (connectionCase_ == 1 + && connection_ + != com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance()) { + connection_ = + com.google.cloud.memorystore.v1beta.PscAutoConnection.newBuilder( + (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + if (connectionCase_ == 1) { + pscAutoConnectionBuilder_.mergeFrom(value); + } else { + pscAutoConnectionBuilder_.setMessage(value); + } + } + connectionCase_ = 1; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + public Builder clearPscAutoConnection() { + if (pscAutoConnectionBuilder_ == null) { + if (connectionCase_ == 1) { + connectionCase_ = 0; + connection_ = null; + onChanged(); + } + } else { + if (connectionCase_ == 1) { + connectionCase_ = 0; + connection_ = null; + } + pscAutoConnectionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + public com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder + getPscAutoConnectionBuilder() { + return getPscAutoConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder + getPscAutoConnectionOrBuilder() { + if ((connectionCase_ == 1) && (pscAutoConnectionBuilder_ != null)) { + return pscAutoConnectionBuilder_.getMessageOrBuilder(); + } else { + if (connectionCase_ == 1) { + return (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created through
+       * service connectivity automation.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connection = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscAutoConnection, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder> + getPscAutoConnectionFieldBuilder() { + if (pscAutoConnectionBuilder_ == null) { + if (!(connectionCase_ == 1)) { + connection_ = + com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance(); + } + pscAutoConnectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscAutoConnection, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder>( + (com.google.cloud.memorystore.v1beta.PscAutoConnection) connection_, + getParentForChildren(), + isClean()); + connection_ = null; + } + connectionCase_ = 1; + onChanged(); + return pscAutoConnectionBuilder_; + } + + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscConnection, + com.google.cloud.memorystore.v1beta.PscConnection.Builder, + com.google.cloud.memorystore.v1beta.PscConnectionOrBuilder> + pscConnectionBuilder_; + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + * + * @return Whether the pscConnection field is set. + */ + @java.lang.Override + public boolean hasPscConnection() { + return connectionCase_ == 2; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + * + * @return The pscConnection. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnection getPscConnection() { + if (pscConnectionBuilder_ == null) { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance(); + } else { + if (connectionCase_ == 2) { + return pscConnectionBuilder_.getMessage(); + } + return com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + public Builder setPscConnection(com.google.cloud.memorystore.v1beta.PscConnection value) { + if (pscConnectionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connection_ = value; + onChanged(); + } else { + pscConnectionBuilder_.setMessage(value); + } + connectionCase_ = 2; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + public Builder setPscConnection( + com.google.cloud.memorystore.v1beta.PscConnection.Builder builderForValue) { + if (pscConnectionBuilder_ == null) { + connection_ = builderForValue.build(); + onChanged(); + } else { + pscConnectionBuilder_.setMessage(builderForValue.build()); + } + connectionCase_ = 2; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + public Builder mergePscConnection(com.google.cloud.memorystore.v1beta.PscConnection value) { + if (pscConnectionBuilder_ == null) { + if (connectionCase_ == 2 + && connection_ + != com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance()) { + connection_ = + com.google.cloud.memorystore.v1beta.PscConnection.newBuilder( + (com.google.cloud.memorystore.v1beta.PscConnection) connection_) + .mergeFrom(value) + .buildPartial(); + } else { + connection_ = value; + } + onChanged(); + } else { + if (connectionCase_ == 2) { + pscConnectionBuilder_.mergeFrom(value); + } else { + pscConnectionBuilder_.setMessage(value); + } + } + connectionCase_ = 2; + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + public Builder clearPscConnection() { + if (pscConnectionBuilder_ == null) { + if (connectionCase_ == 2) { + connectionCase_ = 0; + connection_ = null; + onChanged(); + } + } else { + if (connectionCase_ == 2) { + connectionCase_ = 0; + connection_ = null; + } + pscConnectionBuilder_.clear(); + } + return this; + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + public com.google.cloud.memorystore.v1beta.PscConnection.Builder getPscConnectionBuilder() { + return getPscConnectionFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnectionOrBuilder + getPscConnectionOrBuilder() { + if ((connectionCase_ == 2) && (pscConnectionBuilder_ != null)) { + return pscConnectionBuilder_.getMessageOrBuilder(); + } else { + if (connectionCase_ == 2) { + return (com.google.cloud.memorystore.v1beta.PscConnection) connection_; + } + return com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance(); + } + } + /** + * + * + *
+       * Detailed information of a PSC connection that is created by the user.
+       * 
+ * + * .google.cloud.memorystore.v1beta.PscConnection psc_connection = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscConnection, + com.google.cloud.memorystore.v1beta.PscConnection.Builder, + com.google.cloud.memorystore.v1beta.PscConnectionOrBuilder> + getPscConnectionFieldBuilder() { + if (pscConnectionBuilder_ == null) { + if (!(connectionCase_ == 2)) { + connection_ = com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance(); + } + pscConnectionBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscConnection, + com.google.cloud.memorystore.v1beta.PscConnection.Builder, + com.google.cloud.memorystore.v1beta.PscConnectionOrBuilder>( + (com.google.cloud.memorystore.v1beta.PscConnection) connection_, + getParentForChildren(), + isClean()); + connection_ = null; + } + connectionCase_ = 2; + onChanged(); + return pscConnectionBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1beta.Instance.ConnectionDetail) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.Instance.ConnectionDetail) + private static final com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail(); + } + + public static com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionDetail parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.ConnectionDetail + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int NAME_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object name_ = ""; + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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 = 2; + private com.google.protobuf.Timestamp createTime_; + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + @java.lang.Override + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder() { + return createTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : createTime_; + } + + public static final int UPDATE_TIME_FIELD_NUMBER = 3; + private com.google.protobuf.Timestamp updateTime_; + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + @java.lang.Override + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getUpdateTime() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + return updateTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : updateTime_; + } + + public static final int LABELS_FIELD_NUMBER = 4; + + private static final class LabelsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_LabelsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int STATE_FIELD_NUMBER = 5; + private int state_ = 0; + /** + * + * + *
+   * Output only. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.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. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.State getState() { + com.google.cloud.memorystore.v1beta.Instance.State result = + com.google.cloud.memorystore.v1beta.Instance.State.forNumber(state_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.State.UNRECOGNIZED + : result; + } + + public static final int STATE_INFO_FIELD_NUMBER = 6; + private com.google.cloud.memorystore.v1beta.Instance.StateInfo stateInfo_; + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + @java.lang.Override + public boolean hasStateInfo() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfo getStateInfo() { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1beta.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.StateInfoOrBuilder getStateInfoOrBuilder() { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1beta.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } + + public static final int UID_FIELD_NUMBER = 7; + + @SuppressWarnings("serial") + private volatile java.lang.Object uid_ = ""; + /** + * + * + *
+   * Output only. System assigned, unique identifier for the instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * 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_ & 0x00000008) != 0); + } + /** + * + * + *
+   * Optional. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * 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 = 9; + private int authorizationMode_ = 0; + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode getAuthorizationMode() { + com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode result = + com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode.forNumber( + authorizationMode_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode.UNRECOGNIZED + : result; + } + + public static final int TRANSIT_ENCRYPTION_MODE_FIELD_NUMBER = 10; + private int transitEncryptionMode_ = 0; + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode + getTransitEncryptionMode() { + com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode result = + com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode.forNumber( + transitEncryptionMode_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode.UNRECOGNIZED + : result; + } + + public static final int SHARD_COUNT_FIELD_NUMBER = 11; + private int shardCount_ = 0; + /** + * + * + *
+   * Optional. Number of shards for the instance.
+   * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + + public static final int DISCOVERY_ENDPOINTS_FIELD_NUMBER = 12; + + @SuppressWarnings("serial") + private java.util.List discoveryEndpoints_; + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public java.util.List + getDiscoveryEndpointsOrBuilderList() { + return discoveryEndpoints_; + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public int getDiscoveryEndpointsCount() { + return discoveryEndpoints_.size(); + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint getDiscoveryEndpoints(int index) { + return discoveryEndpoints_.get(index); + } + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.DiscoveryEndpointOrBuilder + getDiscoveryEndpointsOrBuilder(int index) { + return discoveryEndpoints_.get(index); + } + + public static final int NODE_TYPE_FIELD_NUMBER = 13; + private int nodeType_ = 0; + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeType. + */ + @java.lang.Override + public int getNodeTypeValue() { + return nodeType_; + } + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.NodeType getNodeType() { + com.google.cloud.memorystore.v1beta.Instance.NodeType result = + com.google.cloud.memorystore.v1beta.Instance.NodeType.forNumber(nodeType_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.NodeType.UNRECOGNIZED + : result; + } + + public static final int PERSISTENCE_CONFIG_FIELD_NUMBER = 14; + private com.google.cloud.memorystore.v1beta.PersistenceConfig persistenceConfig_; + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the persistenceConfig field is set. + */ + @java.lang.Override + public boolean hasPersistenceConfig() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The persistenceConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig getPersistenceConfig() { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfigOrBuilder + getPersistenceConfigOrBuilder() { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } + + public static final int ENGINE_VERSION_FIELD_NUMBER = 15; + + @SuppressWarnings("serial") + private volatile java.lang.Object engineVersion_ = ""; + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The engineVersion. + */ + @java.lang.Override + public java.lang.String getEngineVersion() { + java.lang.Object ref = engineVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + engineVersion_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for engineVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString getEngineVersionBytes() { + java.lang.Object ref = engineVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + engineVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ENGINE_CONFIGS_FIELD_NUMBER = 16; + + private static final class EngineConfigsDefaultEntryHolder { + static final com.google.protobuf.MapEntry defaultEntry = + com.google.protobuf.MapEntry.newDefaultInstance( + com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_EngineConfigsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + + @SuppressWarnings("serial") + private com.google.protobuf.MapField engineConfigs_; + + private com.google.protobuf.MapField + internalGetEngineConfigs() { + if (engineConfigs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EngineConfigsDefaultEntryHolder.defaultEntry); + } + return engineConfigs_; + } + + public int getEngineConfigsCount() { + return internalGetEngineConfigs().getMap().size(); + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsEngineConfigs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEngineConfigs().getMap().containsKey(key); + } + /** Use {@link #getEngineConfigsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEngineConfigs() { + return getEngineConfigsMap(); + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getEngineConfigsMap() { + return internalGetEngineConfigs().getMap(); + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getEngineConfigsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getEngineConfigsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int NODE_CONFIG_FIELD_NUMBER = 17; + private com.google.cloud.memorystore.v1beta.NodeConfig nodeConfig_; + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nodeConfig field is set. + */ + @java.lang.Override + public boolean hasNodeConfig() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nodeConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.NodeConfig getNodeConfig() { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1beta.NodeConfig.getDefaultInstance() + : nodeConfig_; + } + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.NodeConfigOrBuilder getNodeConfigOrBuilder() { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1beta.NodeConfig.getDefaultInstance() + : nodeConfig_; + } + + public static final int ZONE_DISTRIBUTION_CONFIG_FIELD_NUMBER = 18; + private com.google.cloud.memorystore.v1beta.ZoneDistributionConfig zoneDistributionConfig_; + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the zoneDistributionConfig field is set. + */ + @java.lang.Override + public boolean hasZoneDistributionConfig() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The zoneDistributionConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig getZoneDistributionConfig() { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfigOrBuilder + getZoneDistributionConfigOrBuilder() { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } + + public static final int DELETION_PROTECTION_ENABLED_FIELD_NUMBER = 19; + private boolean deletionProtectionEnabled_ = false; + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the deletionProtectionEnabled field is set. + */ + @java.lang.Override + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The deletionProtectionEnabled. + */ + @java.lang.Override + public boolean getDeletionProtectionEnabled() { + return deletionProtectionEnabled_; + } + + public static final int PSC_AUTO_CONNECTIONS_FIELD_NUMBER = 20; + + @SuppressWarnings("serial") + private java.util.List pscAutoConnections_; + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsList() { + return pscAutoConnections_; + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public java.util.List + getPscAutoConnectionsOrBuilderList() { + return pscAutoConnections_; + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public int getPscAutoConnectionsCount() { + return pscAutoConnections_.size(); + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnection getPscAutoConnections(int index) { + return pscAutoConnections_.get(index); + } + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + return pscAutoConnections_.get(index); + } + + public static final int ENDPOINTS_FIELD_NUMBER = 25; + + @SuppressWarnings("serial") + private java.util.List endpoints_; + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List + getEndpointsList() { + return endpoints_; + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.List< + ? extends com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder> + getEndpointsOrBuilderList() { + return endpoints_; + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public int getEndpointsCount() { + return endpoints_.size(); + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint getEndpoints(int index) { + return endpoints_.get(index); + } + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder + getEndpointsOrBuilder(int index) { + return endpoints_.get(index); + } + + public static final int MODE_FIELD_NUMBER = 26; + private int mode_ = 0; + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.Mode getMode() { + com.google.cloud.memorystore.v1beta.Instance.Mode result = + com.google.cloud.memorystore.v1beta.Instance.Mode.forNumber(mode_); + return result == null ? com.google.cloud.memorystore.v1beta.Instance.Mode.UNRECOGNIZED : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getUpdateTime()); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 4); + if (state_ + != com.google.cloud.memorystore.v1beta.Instance.State.STATE_UNSPECIFIED.getNumber()) { + output.writeEnum(5, state_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeMessage(6, getStateInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 7, uid_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeInt32(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode + .AUTHORIZATION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(9, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(10, transitEncryptionMode_); + } + if (shardCount_ != 0) { + output.writeInt32(11, shardCount_); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + output.writeMessage(12, discoveryEndpoints_.get(i)); + } + if (nodeType_ + != com.google.cloud.memorystore.v1beta.Instance.NodeType.NODE_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(13, nodeType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeMessage(14, getPersistenceConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(engineVersion_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, engineVersion_); + } + com.google.protobuf.GeneratedMessageV3.serializeStringMapTo( + output, internalGetEngineConfigs(), EngineConfigsDefaultEntryHolder.defaultEntry, 16); + if (((bitField0_ & 0x00000020) != 0)) { + output.writeMessage(17, getNodeConfig()); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeMessage(18, getZoneDistributionConfig()); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeBool(19, deletionProtectionEnabled_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + output.writeMessage(20, pscAutoConnections_.get(i)); + } + for (int i = 0; i < endpoints_.size(); i++) { + output.writeMessage(25, endpoints_.get(i)); + } + if (mode_ != com.google.cloud.memorystore.v1beta.Instance.Mode.MODE_UNSPECIFIED.getNumber()) { + output.writeEnum(26, mode_); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getUpdateTime()); + } + for (java.util.Map.Entry entry : + internalGetLabels().getMap().entrySet()) { + com.google.protobuf.MapEntry labels__ = + LabelsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(4, labels__); + } + if (state_ + != com.google.cloud.memorystore.v1beta.Instance.State.STATE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(5, state_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, getStateInfo()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(uid_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, uid_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(8, replicaCount_); + } + if (authorizationMode_ + != com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode + .AUTHORIZATION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(9, authorizationMode_); + } + if (transitEncryptionMode_ + != com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode + .TRANSIT_ENCRYPTION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(10, transitEncryptionMode_); + } + if (shardCount_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(11, shardCount_); + } + for (int i = 0; i < discoveryEndpoints_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(12, discoveryEndpoints_.get(i)); + } + if (nodeType_ + != com.google.cloud.memorystore.v1beta.Instance.NodeType.NODE_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(13, nodeType_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(14, getPersistenceConfig()); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(engineVersion_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, engineVersion_); + } + for (java.util.Map.Entry entry : + internalGetEngineConfigs().getMap().entrySet()) { + com.google.protobuf.MapEntry engineConfigs__ = + EngineConfigsDefaultEntryHolder.defaultEntry + .newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream.computeMessageSize(16, engineConfigs__); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(17, getNodeConfig()); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(18, getZoneDistributionConfig()); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(19, deletionProtectionEnabled_); + } + for (int i = 0; i < pscAutoConnections_.size(); i++) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(20, pscAutoConnections_.get(i)); + } + for (int i = 0; i < endpoints_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(25, endpoints_.get(i)); + } + if (mode_ != com.google.cloud.memorystore.v1beta.Instance.Mode.MODE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(26, mode_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.Instance)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.Instance other = + (com.google.cloud.memorystore.v1beta.Instance) obj; + + if (!getName().equals(other.getName())) return false; + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasUpdateTime() != other.hasUpdateTime()) return false; + if (hasUpdateTime()) { + if (!getUpdateTime().equals(other.getUpdateTime())) return false; + } + if (!internalGetLabels().equals(other.internalGetLabels())) return false; + if (state_ != other.state_) return false; + if (hasStateInfo() != other.hasStateInfo()) return false; + if (hasStateInfo()) { + if (!getStateInfo().equals(other.getStateInfo())) 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 (getShardCount() != other.getShardCount()) return false; + if (!getDiscoveryEndpointsList().equals(other.getDiscoveryEndpointsList())) return false; + if (nodeType_ != other.nodeType_) return false; + if (hasPersistenceConfig() != other.hasPersistenceConfig()) return false; + if (hasPersistenceConfig()) { + if (!getPersistenceConfig().equals(other.getPersistenceConfig())) return false; + } + if (!getEngineVersion().equals(other.getEngineVersion())) return false; + if (!internalGetEngineConfigs().equals(other.internalGetEngineConfigs())) return false; + if (hasNodeConfig() != other.hasNodeConfig()) return false; + if (hasNodeConfig()) { + if (!getNodeConfig().equals(other.getNodeConfig())) return false; + } + if (hasZoneDistributionConfig() != other.hasZoneDistributionConfig()) return false; + if (hasZoneDistributionConfig()) { + if (!getZoneDistributionConfig().equals(other.getZoneDistributionConfig())) return false; + } + if (hasDeletionProtectionEnabled() != other.hasDeletionProtectionEnabled()) return false; + if (hasDeletionProtectionEnabled()) { + if (getDeletionProtectionEnabled() != other.getDeletionProtectionEnabled()) return false; + } + if (!getPscAutoConnectionsList().equals(other.getPscAutoConnectionsList())) return false; + if (!getEndpointsList().equals(other.getEndpointsList())) return false; + if (mode_ != other.mode_) return false; + if (!getUnknownFields().equals(other.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(); + } + if (hasUpdateTime()) { + hash = (37 * hash) + UPDATE_TIME_FIELD_NUMBER; + hash = (53 * hash) + getUpdateTime().hashCode(); + } + if (!internalGetLabels().getMap().isEmpty()) { + hash = (37 * hash) + LABELS_FIELD_NUMBER; + hash = (53 * hash) + internalGetLabels().hashCode(); + } + hash = (37 * hash) + STATE_FIELD_NUMBER; + hash = (53 * hash) + state_; + if (hasStateInfo()) { + hash = (37 * hash) + STATE_INFO_FIELD_NUMBER; + hash = (53 * hash) + getStateInfo().hashCode(); + } + 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_; + hash = (37 * hash) + SHARD_COUNT_FIELD_NUMBER; + hash = (53 * hash) + getShardCount(); + if (getDiscoveryEndpointsCount() > 0) { + hash = (37 * hash) + DISCOVERY_ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getDiscoveryEndpointsList().hashCode(); + } + hash = (37 * hash) + NODE_TYPE_FIELD_NUMBER; + hash = (53 * hash) + nodeType_; + if (hasPersistenceConfig()) { + hash = (37 * hash) + PERSISTENCE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getPersistenceConfig().hashCode(); + } + hash = (37 * hash) + ENGINE_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getEngineVersion().hashCode(); + if (!internalGetEngineConfigs().getMap().isEmpty()) { + hash = (37 * hash) + ENGINE_CONFIGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetEngineConfigs().hashCode(); + } + if (hasNodeConfig()) { + hash = (37 * hash) + NODE_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getNodeConfig().hashCode(); + } + if (hasZoneDistributionConfig()) { + hash = (37 * hash) + ZONE_DISTRIBUTION_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getZoneDistributionConfig().hashCode(); + } + if (hasDeletionProtectionEnabled()) { + hash = (37 * hash) + DELETION_PROTECTION_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getDeletionProtectionEnabled()); + } + if (getPscAutoConnectionsCount() > 0) { + hash = (37 * hash) + PSC_AUTO_CONNECTIONS_FIELD_NUMBER; + hash = (53 * hash) + getPscAutoConnectionsList().hashCode(); + } + if (getEndpointsCount() > 0) { + hash = (37 * hash) + ENDPOINTS_FIELD_NUMBER; + hash = (53 * hash) + getEndpointsList().hashCode(); + } + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.Instance parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1beta.Instance prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * A Memorystore instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.Instance} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.Instance) + com.google.cloud.memorystore.v1beta.InstanceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetLabels(); + case 16: + return internalGetEngineConfigs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 4: + return internalGetMutableLabels(); + case 16: + return internalGetMutableEngineConfigs(); + default: + throw new RuntimeException("Invalid map field number: " + number); + } + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.Instance.class, + com.google.cloud.memorystore.v1beta.Instance.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.Instance.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getUpdateTimeFieldBuilder(); + getStateInfoFieldBuilder(); + getDiscoveryEndpointsFieldBuilder(); + getPersistenceConfigFieldBuilder(); + getNodeConfigFieldBuilder(); + getZoneDistributionConfigFieldBuilder(); + getPscAutoConnectionsFieldBuilder(); + getEndpointsFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + name_ = ""; + createTime_ = null; + if (createTimeBuilder_ != null) { + createTimeBuilder_.dispose(); + createTimeBuilder_ = null; + } + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + internalGetMutableLabels().clear(); + state_ = 0; + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + uid_ = ""; + replicaCount_ = 0; + authorizationMode_ = 0; + transitEncryptionMode_ = 0; + shardCount_ = 0; + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + } else { + discoveryEndpoints_ = null; + discoveryEndpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000800); + nodeType_ = 0; + persistenceConfig_ = null; + if (persistenceConfigBuilder_ != null) { + persistenceConfigBuilder_.dispose(); + persistenceConfigBuilder_ = null; + } + engineVersion_ = ""; + internalGetMutableEngineConfigs().clear(); + nodeConfig_ = null; + if (nodeConfigBuilder_ != null) { + nodeConfigBuilder_.dispose(); + nodeConfigBuilder_ = null; + } + zoneDistributionConfig_ = null; + if (zoneDistributionConfigBuilder_ != null) { + zoneDistributionConfigBuilder_.dispose(); + zoneDistributionConfigBuilder_ = null; + } + deletionProtectionEnabled_ = false; + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + } else { + pscAutoConnections_ = null; + pscAutoConnectionsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00080000); + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + } else { + endpoints_ = null; + endpointsBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00100000); + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_Instance_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance build() { + com.google.cloud.memorystore.v1beta.Instance result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance buildPartial() { + com.google.cloud.memorystore.v1beta.Instance result = + new com.google.cloud.memorystore.v1beta.Instance(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.google.cloud.memorystore.v1beta.Instance result) { + if (discoveryEndpointsBuilder_ == null) { + if (((bitField0_ & 0x00000800) != 0)) { + discoveryEndpoints_ = java.util.Collections.unmodifiableList(discoveryEndpoints_); + bitField0_ = (bitField0_ & ~0x00000800); + } + result.discoveryEndpoints_ = discoveryEndpoints_; + } else { + result.discoveryEndpoints_ = discoveryEndpointsBuilder_.build(); + } + if (pscAutoConnectionsBuilder_ == null) { + if (((bitField0_ & 0x00080000) != 0)) { + pscAutoConnections_ = java.util.Collections.unmodifiableList(pscAutoConnections_); + bitField0_ = (bitField0_ & ~0x00080000); + } + result.pscAutoConnections_ = pscAutoConnections_; + } else { + result.pscAutoConnections_ = pscAutoConnectionsBuilder_.build(); + } + if (endpointsBuilder_ == null) { + if (((bitField0_ & 0x00100000) != 0)) { + endpoints_ = java.util.Collections.unmodifiableList(endpoints_); + bitField0_ = (bitField0_ & ~0x00100000); + } + result.endpoints_ = endpoints_; + } else { + result.endpoints_ = endpointsBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.Instance result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.name_ = name_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.updateTime_ = updateTimeBuilder_ == null ? updateTime_ : updateTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.labels_ = internalGetLabels(); + result.labels_.makeImmutable(); + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.state_ = state_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.stateInfo_ = stateInfoBuilder_ == null ? stateInfo_ : stateInfoBuilder_.build(); + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.uid_ = uid_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.replicaCount_ = replicaCount_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.authorizationMode_ = authorizationMode_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.transitEncryptionMode_ = transitEncryptionMode_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.shardCount_ = shardCount_; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.nodeType_ = nodeType_; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + result.persistenceConfig_ = + persistenceConfigBuilder_ == null + ? persistenceConfig_ + : persistenceConfigBuilder_.build(); + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00004000) != 0)) { + result.engineVersion_ = engineVersion_; + } + if (((from_bitField0_ & 0x00008000) != 0)) { + result.engineConfigs_ = internalGetEngineConfigs(); + result.engineConfigs_.makeImmutable(); + } + if (((from_bitField0_ & 0x00010000) != 0)) { + result.nodeConfig_ = nodeConfigBuilder_ == null ? nodeConfig_ : nodeConfigBuilder_.build(); + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00020000) != 0)) { + result.zoneDistributionConfig_ = + zoneDistributionConfigBuilder_ == null + ? zoneDistributionConfig_ + : zoneDistributionConfigBuilder_.build(); + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00040000) != 0)) { + result.deletionProtectionEnabled_ = deletionProtectionEnabled_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00200000) != 0)) { + result.mode_ = mode_; + } + 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.memorystore.v1beta.Instance) { + return mergeFrom((com.google.cloud.memorystore.v1beta.Instance) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.Instance other) { + if (other == com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasUpdateTime()) { + mergeUpdateTime(other.getUpdateTime()); + } + internalGetMutableLabels().mergeFrom(other.internalGetLabels()); + bitField0_ |= 0x00000008; + if (other.state_ != 0) { + setStateValue(other.getStateValue()); + } + if (other.hasStateInfo()) { + mergeStateInfo(other.getStateInfo()); + } + if (!other.getUid().isEmpty()) { + uid_ = other.uid_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.hasReplicaCount()) { + setReplicaCount(other.getReplicaCount()); + } + if (other.authorizationMode_ != 0) { + setAuthorizationModeValue(other.getAuthorizationModeValue()); + } + if (other.transitEncryptionMode_ != 0) { + setTransitEncryptionModeValue(other.getTransitEncryptionModeValue()); + } + if (other.getShardCount() != 0) { + setShardCount(other.getShardCount()); + } + if (discoveryEndpointsBuilder_ == null) { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpoints_.isEmpty()) { + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000800); + } else { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.addAll(other.discoveryEndpoints_); + } + onChanged(); + } + } else { + if (!other.discoveryEndpoints_.isEmpty()) { + if (discoveryEndpointsBuilder_.isEmpty()) { + discoveryEndpointsBuilder_.dispose(); + discoveryEndpointsBuilder_ = null; + discoveryEndpoints_ = other.discoveryEndpoints_; + bitField0_ = (bitField0_ & ~0x00000800); + discoveryEndpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getDiscoveryEndpointsFieldBuilder() + : null; + } else { + discoveryEndpointsBuilder_.addAllMessages(other.discoveryEndpoints_); + } + } + } + if (other.nodeType_ != 0) { + setNodeTypeValue(other.getNodeTypeValue()); + } + if (other.hasPersistenceConfig()) { + mergePersistenceConfig(other.getPersistenceConfig()); + } + if (!other.getEngineVersion().isEmpty()) { + engineVersion_ = other.engineVersion_; + bitField0_ |= 0x00004000; + onChanged(); + } + internalGetMutableEngineConfigs().mergeFrom(other.internalGetEngineConfigs()); + bitField0_ |= 0x00008000; + if (other.hasNodeConfig()) { + mergeNodeConfig(other.getNodeConfig()); + } + if (other.hasZoneDistributionConfig()) { + mergeZoneDistributionConfig(other.getZoneDistributionConfig()); + } + if (other.hasDeletionProtectionEnabled()) { + setDeletionProtectionEnabled(other.getDeletionProtectionEnabled()); + } + if (pscAutoConnectionsBuilder_ == null) { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnections_.isEmpty()) { + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00080000); + } else { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.addAll(other.pscAutoConnections_); + } + onChanged(); + } + } else { + if (!other.pscAutoConnections_.isEmpty()) { + if (pscAutoConnectionsBuilder_.isEmpty()) { + pscAutoConnectionsBuilder_.dispose(); + pscAutoConnectionsBuilder_ = null; + pscAutoConnections_ = other.pscAutoConnections_; + bitField0_ = (bitField0_ & ~0x00080000); + pscAutoConnectionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getPscAutoConnectionsFieldBuilder() + : null; + } else { + pscAutoConnectionsBuilder_.addAllMessages(other.pscAutoConnections_); + } + } + } + if (endpointsBuilder_ == null) { + if (!other.endpoints_.isEmpty()) { + if (endpoints_.isEmpty()) { + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00100000); + } else { + ensureEndpointsIsMutable(); + endpoints_.addAll(other.endpoints_); + } + onChanged(); + } + } else { + if (!other.endpoints_.isEmpty()) { + if (endpointsBuilder_.isEmpty()) { + endpointsBuilder_.dispose(); + endpointsBuilder_ = null; + endpoints_ = other.endpoints_; + bitField0_ = (bitField0_ & ~0x00100000); + endpointsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getEndpointsFieldBuilder() + : null; + } else { + endpointsBuilder_.addAllMessages(other.endpoints_); + } + } + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + input.readMessage(getCreateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getUpdateTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + com.google.protobuf.MapEntry labels__ = + input.readMessage( + LabelsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableLabels() + .getMutableMap() + .put(labels__.getKey(), labels__.getValue()); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 40: + { + state_ = input.readEnum(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 50: + { + input.readMessage(getStateInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 58: + { + uid_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 64: + { + replicaCount_ = input.readInt32(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: + { + authorizationMode_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: + { + transitEncryptionMode_ = input.readEnum(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: + { + shardCount_ = input.readInt32(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 98: + { + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint m = + input.readMessage( + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.parser(), + extensionRegistry); + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(m); + } else { + discoveryEndpointsBuilder_.addMessage(m); + } + break; + } // case 98 + case 104: + { + nodeType_ = input.readEnum(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: + { + input.readMessage( + getPersistenceConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: + { + engineVersion_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 130: + { + com.google.protobuf.MapEntry engineConfigs__ = + input.readMessage( + EngineConfigsDefaultEntryHolder.defaultEntry.getParserForType(), + extensionRegistry); + internalGetMutableEngineConfigs() + .getMutableMap() + .put(engineConfigs__.getKey(), engineConfigs__.getValue()); + bitField0_ |= 0x00008000; + break; + } // case 130 + case 138: + { + input.readMessage(getNodeConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00010000; + break; + } // case 138 + case 146: + { + input.readMessage( + getZoneDistributionConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00020000; + break; + } // case 146 + case 152: + { + deletionProtectionEnabled_ = input.readBool(); + bitField0_ |= 0x00040000; + break; + } // case 152 + case 162: + { + com.google.cloud.memorystore.v1beta.PscAutoConnection m = + input.readMessage( + com.google.cloud.memorystore.v1beta.PscAutoConnection.parser(), + extensionRegistry); + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(m); + } else { + pscAutoConnectionsBuilder_.addMessage(m); + } + break; + } // case 162 + case 202: + { + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint m = + input.readMessage( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.parser(), + extensionRegistry); + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(m); + } else { + endpointsBuilder_.addMessage(m); + } + break; + } // case 202 + case 208: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00200000; + break; + } // case 208 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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_ = ""; + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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; + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return This builder for chaining. + */ + public Builder clearName() { + name_ = getDefaultInstance().getName(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Identifier. Unique name of the instance.
+     * Format: projects/{project}/locations/{location}/instances/{instance}
+     * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + public boolean hasCreateTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Output only. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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); + } + if (createTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getCreateTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getCreateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_time = 2 [(.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. Creation timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp create_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> + getCreateTimeFieldBuilder() { + if (createTimeBuilder_ == null) { + createTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getCreateTime(), getParentForChildren(), isClean()); + createTime_ = null; + } + return createTimeBuilder_; + } + + private com.google.protobuf.Timestamp updateTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + updateTimeBuilder_; + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + public boolean hasUpdateTime() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + public com.google.protobuf.Timestamp getUpdateTime() { + if (updateTimeBuilder_ == null) { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } else { + return updateTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateTime_ = value; + } else { + updateTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setUpdateTime(com.google.protobuf.Timestamp.Builder builderForValue) { + if (updateTimeBuilder_ == null) { + updateTime_ = builderForValue.build(); + } else { + updateTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeUpdateTime(com.google.protobuf.Timestamp value) { + if (updateTimeBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && updateTime_ != null + && updateTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getUpdateTimeBuilder().mergeFrom(value); + } else { + updateTime_ = value; + } + } else { + updateTimeBuilder_.mergeFrom(value); + } + if (updateTime_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearUpdateTime() { + bitField0_ = (bitField0_ & ~0x00000004); + updateTime_ = null; + if (updateTimeBuilder_ != null) { + updateTimeBuilder_.dispose(); + updateTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.Timestamp.Builder getUpdateTimeBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getUpdateTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder() { + if (updateTimeBuilder_ != null) { + return updateTimeBuilder_.getMessageOrBuilder(); + } else { + return updateTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : updateTime_; + } + } + /** + * + * + *
+     * Output only. Latest update timestamp of the instance.
+     * 
+ * + * + * .google.protobuf.Timestamp update_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> + getUpdateTimeFieldBuilder() { + if (updateTimeBuilder_ == null) { + updateTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getUpdateTime(), getParentForChildren(), isClean()); + updateTime_ = null; + } + return updateTimeBuilder_; + } + + private com.google.protobuf.MapField labels_; + + private com.google.protobuf.MapField internalGetLabels() { + if (labels_ == null) { + return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry); + } + return labels_; + } + + private com.google.protobuf.MapField + internalGetMutableLabels() { + if (labels_ == null) { + labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry); + } + if (!labels_.isMutable()) { + labels_ = labels_.copy(); + } + bitField0_ |= 0x00000008; + onChanged(); + return labels_; + } + + public int getLabelsCount() { + return internalGetLabels().getMap().size(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public boolean containsLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetLabels().getMap().containsKey(key); + } + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getLabels() { + return getLabelsMap(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.util.Map getLabelsMap() { + return internalGetLabels().getMap(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public /* nullable */ java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + @java.lang.Override + public java.lang.String getLabelsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetLabels().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearLabels() { + bitField0_ = (bitField0_ & ~0x00000008); + internalGetMutableLabels().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder removeLabels(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableLabels().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableLabels() { + bitField0_ |= 0x00000008; + return internalGetMutableLabels().getMutableMap(); + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putLabels(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableLabels().getMutableMap().put(key, value); + bitField0_ |= 0x00000008; + return this; + } + /** + * + * + *
+     * Optional. Labels to represent user-provided metadata.
+     * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + public Builder putAllLabels(java.util.Map values) { + internalGetMutableLabels().getMutableMap().putAll(values); + bitField0_ |= 0x00000008; + return this; + } + + private int state_ = 0; + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.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. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.State getState() { + com.google.cloud.memorystore.v1beta.Instance.State result = + com.google.cloud.memorystore.v1beta.Instance.State.forNumber(state_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.State.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The state to set. + * @return This builder for chaining. + */ + public Builder setState(com.google.cloud.memorystore.v1beta.Instance.State value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000010; + state_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Current state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearState() { + bitField0_ = (bitField0_ & ~0x00000010); + state_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1beta.Instance.StateInfo stateInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.StateInfo, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.Builder, + com.google.cloud.memorystore.v1beta.Instance.StateInfoOrBuilder> + stateInfoBuilder_; + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + public boolean hasStateInfo() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + public com.google.cloud.memorystore.v1beta.Instance.StateInfo getStateInfo() { + if (stateInfoBuilder_ == null) { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1beta.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } else { + return stateInfoBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo(com.google.cloud.memorystore.v1beta.Instance.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + stateInfo_ = value; + } else { + stateInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setStateInfo( + com.google.cloud.memorystore.v1beta.Instance.StateInfo.Builder builderForValue) { + if (stateInfoBuilder_ == null) { + stateInfo_ = builderForValue.build(); + } else { + stateInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeStateInfo(com.google.cloud.memorystore.v1beta.Instance.StateInfo value) { + if (stateInfoBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0) + && stateInfo_ != null + && stateInfo_ + != com.google.cloud.memorystore.v1beta.Instance.StateInfo.getDefaultInstance()) { + getStateInfoBuilder().mergeFrom(value); + } else { + stateInfo_ = value; + } + } else { + stateInfoBuilder_.mergeFrom(value); + } + if (stateInfo_ != null) { + bitField0_ |= 0x00000020; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearStateInfo() { + bitField0_ = (bitField0_ & ~0x00000020); + stateInfo_ = null; + if (stateInfoBuilder_ != null) { + stateInfoBuilder_.dispose(); + stateInfoBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.StateInfo.Builder getStateInfoBuilder() { + bitField0_ |= 0x00000020; + onChanged(); + return getStateInfoFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.StateInfoOrBuilder getStateInfoOrBuilder() { + if (stateInfoBuilder_ != null) { + return stateInfoBuilder_.getMessageOrBuilder(); + } else { + return stateInfo_ == null + ? com.google.cloud.memorystore.v1beta.Instance.StateInfo.getDefaultInstance() + : stateInfo_; + } + } + /** + * + * + *
+     * Output only. Additional information about the state of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.StateInfo, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.Builder, + com.google.cloud.memorystore.v1beta.Instance.StateInfoOrBuilder> + getStateInfoFieldBuilder() { + if (stateInfoBuilder_ == null) { + stateInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.StateInfo, + com.google.cloud.memorystore.v1beta.Instance.StateInfo.Builder, + com.google.cloud.memorystore.v1beta.Instance.StateInfoOrBuilder>( + getStateInfo(), getParentForChildren(), isClean()); + stateInfo_ = null; + } + return stateInfoBuilder_; + } + + private java.lang.Object uid_ = ""; + /** + * + * + *
+     * Output only. System assigned, unique identifier for the instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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 instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearUid() { + uid_ = getDefaultInstance().getUid(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. System assigned, unique identifier for the instance.
+     * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @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_ |= 0x00000040; + onChanged(); + return this; + } + + private int replicaCount_; + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * 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_ & 0x00000080) != 0); + } + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + @java.lang.Override + public int getReplicaCount() { + return replicaCount_; + } + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * 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_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Number of replica nodes per shard. If omitted the default is 0
+     * replicas.
+     * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearReplicaCount() { + bitField0_ = (bitField0_ & ~0x00000080); + replicaCount_ = 0; + onChanged(); + return this; + } + + private int authorizationMode_ = 0; + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + @java.lang.Override + public int getAuthorizationModeValue() { + return authorizationMode_; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The authorizationMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode getAuthorizationMode() { + com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode result = + com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode.forNumber( + authorizationMode_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The authorizationMode to set. + * @return This builder for chaining. + */ + public Builder setAuthorizationMode( + com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + authorizationMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Authorization mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearAuthorizationMode() { + bitField0_ = (bitField0_ & ~0x00000100); + authorizationMode_ = 0; + onChanged(); + return this; + } + + private int transitEncryptionMode_ = 0; + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + @java.lang.Override + public int getTransitEncryptionModeValue() { + return transitEncryptionMode_; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @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_ |= 0x00000200; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The transitEncryptionMode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode + getTransitEncryptionMode() { + com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode result = + com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode.forNumber( + transitEncryptionMode_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The transitEncryptionMode to set. + * @return This builder for chaining. + */ + public Builder setTransitEncryptionMode( + com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + transitEncryptionMode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. In-transit encryption mode of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearTransitEncryptionMode() { + bitField0_ = (bitField0_ & ~0x00000200); + transitEncryptionMode_ = 0; + onChanged(); + return this; + } + + private int shardCount_; + /** + * + * + *
+     * Optional. Number of shards for the instance.
+     * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The shardCount. + */ + @java.lang.Override + public int getShardCount() { + return shardCount_; + } + /** + * + * + *
+     * Optional. Number of shards for the instance.
+     * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The shardCount to set. + * @return This builder for chaining. + */ + public Builder setShardCount(int value) { + + shardCount_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Number of shards for the instance.
+     * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearShardCount() { + bitField0_ = (bitField0_ & ~0x00000400); + shardCount_ = 0; + onChanged(); + return this; + } + + private java.util.List + discoveryEndpoints_ = java.util.Collections.emptyList(); + + private void ensureDiscoveryEndpointsIsMutable() { + if (!((bitField0_ & 0x00000800) != 0)) { + discoveryEndpoints_ = + new java.util.ArrayList( + discoveryEndpoints_); + bitField0_ |= 0x00000800; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint, + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder, + com.google.cloud.memorystore.v1beta.DiscoveryEndpointOrBuilder> + discoveryEndpointsBuilder_; + + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public int getDiscoveryEndpointsCount() { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.size(); + } else { + return discoveryEndpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint getDiscoveryEndpoints(int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, com.google.cloud.memorystore.v1beta.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setDiscoveryEndpoints( + int index, com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + com.google.cloud.memorystore.v1beta.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, com.google.cloud.memorystore.v1beta.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder addDiscoveryEndpoints( + int index, com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder builderForValue) { + if (discoveryEndpointsBuilder_ == null) { + ensureDiscoveryEndpointsIsMutable(); + discoveryEndpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + discoveryEndpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearDiscoveryEndpoints() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000800); + onChanged(); + } else { + discoveryEndpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder + getDiscoveryEndpointsBuilder(int index) { + return getDiscoveryEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.DiscoveryEndpointOrBuilder + getDiscoveryEndpointsOrBuilder(int index) { + if (discoveryEndpointsBuilder_ == null) { + return discoveryEndpoints_.get(index); + } else { + return discoveryEndpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.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 clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder + addDiscoveryEndpointsBuilder() { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder(com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder + addDiscoveryEndpointsBuilder(int index) { + return getDiscoveryEndpointsFieldBuilder() + .addBuilder( + index, com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Output only. Endpoints clients can connect to the instance through.
+     * Currently only one discovery endpoint is supported.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public java.util.List + getDiscoveryEndpointsBuilderList() { + return getDiscoveryEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint, + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder, + com.google.cloud.memorystore.v1beta.DiscoveryEndpointOrBuilder> + getDiscoveryEndpointsFieldBuilder() { + if (discoveryEndpointsBuilder_ == null) { + discoveryEndpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint, + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint.Builder, + com.google.cloud.memorystore.v1beta.DiscoveryEndpointOrBuilder>( + discoveryEndpoints_, + ((bitField0_ & 0x00000800) != 0), + getParentForChildren(), + isClean()); + discoveryEndpoints_ = null; + } + return discoveryEndpointsBuilder_; + } + + private int nodeType_ = 0; + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeType. + */ + @java.lang.Override + public int getNodeTypeValue() { + return nodeType_; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The enum numeric value on the wire for nodeType to set. + * @return This builder for chaining. + */ + public Builder setNodeTypeValue(int value) { + nodeType_ = value; + bitField0_ |= 0x00001000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.NodeType getNodeType() { + com.google.cloud.memorystore.v1beta.Instance.NodeType result = + com.google.cloud.memorystore.v1beta.Instance.NodeType.forNumber(nodeType_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.NodeType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The nodeType to set. + * @return This builder for chaining. + */ + public Builder setNodeType(com.google.cloud.memorystore.v1beta.Instance.NodeType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00001000; + nodeType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Machine type for individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearNodeType() { + bitField0_ = (bitField0_ & ~0x00001000); + nodeType_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1beta.PersistenceConfig persistenceConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfigOrBuilder> + persistenceConfigBuilder_; + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the persistenceConfig field is set. + */ + public boolean hasPersistenceConfig() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The persistenceConfig. + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig getPersistenceConfig() { + if (persistenceConfigBuilder_ == null) { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } else { + return persistenceConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPersistenceConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig value) { + if (persistenceConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + persistenceConfig_ = value; + } else { + persistenceConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setPersistenceConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig.Builder builderForValue) { + if (persistenceConfigBuilder_ == null) { + persistenceConfig_ = builderForValue.build(); + } else { + persistenceConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00002000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergePersistenceConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig value) { + if (persistenceConfigBuilder_ == null) { + if (((bitField0_ & 0x00002000) != 0) + && persistenceConfig_ != null + && persistenceConfig_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.getDefaultInstance()) { + getPersistenceConfigBuilder().mergeFrom(value); + } else { + persistenceConfig_ = value; + } + } else { + persistenceConfigBuilder_.mergeFrom(value); + } + if (persistenceConfig_ != null) { + bitField0_ |= 0x00002000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearPersistenceConfig() { + bitField0_ = (bitField0_ & ~0x00002000); + persistenceConfig_ = null; + if (persistenceConfigBuilder_ != null) { + persistenceConfigBuilder_.dispose(); + persistenceConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig.Builder + getPersistenceConfigBuilder() { + bitField0_ |= 0x00002000; + onChanged(); + return getPersistenceConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfigOrBuilder + getPersistenceConfigOrBuilder() { + if (persistenceConfigBuilder_ != null) { + return persistenceConfigBuilder_.getMessageOrBuilder(); + } else { + return persistenceConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.getDefaultInstance() + : persistenceConfig_; + } + } + /** + * + * + *
+     * Optional. Persistence configuration of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfigOrBuilder> + getPersistenceConfigFieldBuilder() { + if (persistenceConfigBuilder_ == null) { + persistenceConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfigOrBuilder>( + getPersistenceConfig(), getParentForChildren(), isClean()); + persistenceConfig_ = null; + } + return persistenceConfigBuilder_; + } + + private java.lang.Object engineVersion_ = ""; + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The engineVersion. + */ + public java.lang.String getEngineVersion() { + java.lang.Object ref = engineVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + engineVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for engineVersion. + */ + public com.google.protobuf.ByteString getEngineVersionBytes() { + java.lang.Object ref = engineVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + engineVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The engineVersion to set. + * @return This builder for chaining. + */ + public Builder setEngineVersion(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + engineVersion_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return This builder for chaining. + */ + public Builder clearEngineVersion() { + engineVersion_ = getDefaultInstance().getEngineVersion(); + bitField0_ = (bitField0_ & ~0x00004000); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Engine version of the instance.
+     * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @param value The bytes for engineVersion to set. + * @return This builder for chaining. + */ + public Builder setEngineVersionBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + engineVersion_ = value; + bitField0_ |= 0x00004000; + onChanged(); + return this; + } + + private com.google.protobuf.MapField engineConfigs_; + + private com.google.protobuf.MapField + internalGetEngineConfigs() { + if (engineConfigs_ == null) { + return com.google.protobuf.MapField.emptyMapField( + EngineConfigsDefaultEntryHolder.defaultEntry); + } + return engineConfigs_; + } + + private com.google.protobuf.MapField + internalGetMutableEngineConfigs() { + if (engineConfigs_ == null) { + engineConfigs_ = + com.google.protobuf.MapField.newMapField(EngineConfigsDefaultEntryHolder.defaultEntry); + } + if (!engineConfigs_.isMutable()) { + engineConfigs_ = engineConfigs_.copy(); + } + bitField0_ |= 0x00008000; + onChanged(); + return engineConfigs_; + } + + public int getEngineConfigsCount() { + return internalGetEngineConfigs().getMap().size(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public boolean containsEngineConfigs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + return internalGetEngineConfigs().getMap().containsKey(key); + } + /** Use {@link #getEngineConfigsMap()} instead. */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getEngineConfigs() { + return getEngineConfigsMap(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.util.Map getEngineConfigsMap() { + return internalGetEngineConfigs().getMap(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public /* nullable */ java.lang.String getEngineConfigsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public java.lang.String getEngineConfigsOrThrow(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + java.util.Map map = internalGetEngineConfigs().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearEngineConfigs() { + bitField0_ = (bitField0_ & ~0x00008000); + internalGetMutableEngineConfigs().getMutableMap().clear(); + return this; + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeEngineConfigs(java.lang.String key) { + if (key == null) { + throw new NullPointerException("map key"); + } + internalGetMutableEngineConfigs().getMutableMap().remove(key); + return this; + } + /** Use alternate mutation accessors instead. */ + @java.lang.Deprecated + public java.util.Map getMutableEngineConfigs() { + bitField0_ |= 0x00008000; + return internalGetMutableEngineConfigs().getMutableMap(); + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putEngineConfigs(java.lang.String key, java.lang.String value) { + if (key == null) { + throw new NullPointerException("map key"); + } + if (value == null) { + throw new NullPointerException("map value"); + } + internalGetMutableEngineConfigs().getMutableMap().put(key, value); + bitField0_ |= 0x00008000; + return this; + } + /** + * + * + *
+     * Optional. User-provided engine configurations for the instance.
+     * 
+ * + * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder putAllEngineConfigs(java.util.Map values) { + internalGetMutableEngineConfigs().getMutableMap().putAll(values); + bitField0_ |= 0x00008000; + return this; + } + + private com.google.cloud.memorystore.v1beta.NodeConfig nodeConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.NodeConfig, + com.google.cloud.memorystore.v1beta.NodeConfig.Builder, + com.google.cloud.memorystore.v1beta.NodeConfigOrBuilder> + nodeConfigBuilder_; + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nodeConfig field is set. + */ + public boolean hasNodeConfig() { + return ((bitField0_ & 0x00010000) != 0); + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nodeConfig. + */ + public com.google.cloud.memorystore.v1beta.NodeConfig getNodeConfig() { + if (nodeConfigBuilder_ == null) { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1beta.NodeConfig.getDefaultInstance() + : nodeConfig_; + } else { + return nodeConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodeConfig(com.google.cloud.memorystore.v1beta.NodeConfig value) { + if (nodeConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + nodeConfig_ = value; + } else { + nodeConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder setNodeConfig( + com.google.cloud.memorystore.v1beta.NodeConfig.Builder builderForValue) { + if (nodeConfigBuilder_ == null) { + nodeConfig_ = builderForValue.build(); + } else { + nodeConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00010000; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder mergeNodeConfig(com.google.cloud.memorystore.v1beta.NodeConfig value) { + if (nodeConfigBuilder_ == null) { + if (((bitField0_ & 0x00010000) != 0) + && nodeConfig_ != null + && nodeConfig_ != com.google.cloud.memorystore.v1beta.NodeConfig.getDefaultInstance()) { + getNodeConfigBuilder().mergeFrom(value); + } else { + nodeConfig_ = value; + } + } else { + nodeConfigBuilder_.mergeFrom(value); + } + if (nodeConfig_ != null) { + bitField0_ |= 0x00010000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public Builder clearNodeConfig() { + bitField0_ = (bitField0_ & ~0x00010000); + nodeConfig_ = null; + if (nodeConfigBuilder_ != null) { + nodeConfigBuilder_.dispose(); + nodeConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.NodeConfig.Builder getNodeConfigBuilder() { + bitField0_ |= 0x00010000; + onChanged(); + return getNodeConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + public com.google.cloud.memorystore.v1beta.NodeConfigOrBuilder getNodeConfigOrBuilder() { + if (nodeConfigBuilder_ != null) { + return nodeConfigBuilder_.getMessageOrBuilder(); + } else { + return nodeConfig_ == null + ? com.google.cloud.memorystore.v1beta.NodeConfig.getDefaultInstance() + : nodeConfig_; + } + } + /** + * + * + *
+     * Output only. Configuration of individual nodes of the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.NodeConfig, + com.google.cloud.memorystore.v1beta.NodeConfig.Builder, + com.google.cloud.memorystore.v1beta.NodeConfigOrBuilder> + getNodeConfigFieldBuilder() { + if (nodeConfigBuilder_ == null) { + nodeConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.NodeConfig, + com.google.cloud.memorystore.v1beta.NodeConfig.Builder, + com.google.cloud.memorystore.v1beta.NodeConfigOrBuilder>( + getNodeConfig(), getParentForChildren(), isClean()); + nodeConfig_ = null; + } + return nodeConfigBuilder_; + } + + private com.google.cloud.memorystore.v1beta.ZoneDistributionConfig zoneDistributionConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.Builder, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfigOrBuilder> + zoneDistributionConfigBuilder_; + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the zoneDistributionConfig field is set. + */ + public boolean hasZoneDistributionConfig() { + return ((bitField0_ & 0x00020000) != 0); + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The zoneDistributionConfig. + */ + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig getZoneDistributionConfig() { + if (zoneDistributionConfigBuilder_ == null) { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } else { + return zoneDistributionConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setZoneDistributionConfig( + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig value) { + if (zoneDistributionConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + zoneDistributionConfig_ = value; + } else { + zoneDistributionConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setZoneDistributionConfig( + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.Builder builderForValue) { + if (zoneDistributionConfigBuilder_ == null) { + zoneDistributionConfig_ = builderForValue.build(); + } else { + zoneDistributionConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00020000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder mergeZoneDistributionConfig( + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig value) { + if (zoneDistributionConfigBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0) + && zoneDistributionConfig_ != null + && zoneDistributionConfig_ + != com.google.cloud.memorystore.v1beta.ZoneDistributionConfig + .getDefaultInstance()) { + getZoneDistributionConfigBuilder().mergeFrom(value); + } else { + zoneDistributionConfig_ = value; + } + } else { + zoneDistributionConfigBuilder_.mergeFrom(value); + } + if (zoneDistributionConfig_ != null) { + bitField0_ |= 0x00020000; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearZoneDistributionConfig() { + bitField0_ = (bitField0_ & ~0x00020000); + zoneDistributionConfig_ = null; + if (zoneDistributionConfigBuilder_ != null) { + zoneDistributionConfigBuilder_.dispose(); + zoneDistributionConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.Builder + getZoneDistributionConfigBuilder() { + bitField0_ |= 0x00020000; + onChanged(); + return getZoneDistributionConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfigOrBuilder + getZoneDistributionConfigOrBuilder() { + if (zoneDistributionConfigBuilder_ != null) { + return zoneDistributionConfigBuilder_.getMessageOrBuilder(); + } else { + return zoneDistributionConfig_ == null + ? com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.getDefaultInstance() + : zoneDistributionConfig_; + } + } + /** + * + * + *
+     * Optional. Immutable. Zone distribution configuration of the instance for
+     * node allocation.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.Builder, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfigOrBuilder> + getZoneDistributionConfigFieldBuilder() { + if (zoneDistributionConfigBuilder_ == null) { + zoneDistributionConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.Builder, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfigOrBuilder>( + getZoneDistributionConfig(), getParentForChildren(), isClean()); + zoneDistributionConfig_ = null; + } + return zoneDistributionConfigBuilder_; + } + + private boolean deletionProtectionEnabled_; + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the deletionProtectionEnabled field is set. + */ + @java.lang.Override + public boolean hasDeletionProtectionEnabled() { + return ((bitField0_ & 0x00040000) != 0); + } + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The deletionProtectionEnabled. + */ + @java.lang.Override + public boolean getDeletionProtectionEnabled() { + return deletionProtectionEnabled_; + } + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The deletionProtectionEnabled to set. + * @return This builder for chaining. + */ + public Builder setDeletionProtectionEnabled(boolean value) { + + deletionProtectionEnabled_ = value; + bitField0_ |= 0x00040000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. If set to true deletion of the instance will fail.
+     * 
+ * + * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearDeletionProtectionEnabled() { + bitField0_ = (bitField0_ & ~0x00040000); + deletionProtectionEnabled_ = false; + onChanged(); + return this; + } + + private java.util.List + pscAutoConnections_ = java.util.Collections.emptyList(); + + private void ensurePscAutoConnectionsIsMutable() { + if (!((bitField0_ & 0x00080000) != 0)) { + pscAutoConnections_ = + new java.util.ArrayList( + pscAutoConnections_); + bitField0_ |= 0x00080000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscAutoConnection, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder> + pscAutoConnectionsBuilder_; + + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getPscAutoConnectionsList() { + if (pscAutoConnectionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } else { + return pscAutoConnectionsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public int getPscAutoConnectionsCount() { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.size(); + } else { + return pscAutoConnectionsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1beta.PscAutoConnection getPscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.memorystore.v1beta.PscAutoConnection value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder setPscAutoConnections( + int index, com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.set(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.memorystore.v1beta.PscAutoConnection value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.memorystore.v1beta.PscAutoConnection value) { + if (pscAutoConnectionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, value); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections( + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addPscAutoConnections( + int index, com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder builderForValue) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.add(index, builderForValue.build()); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder addAllPscAutoConnections( + java.lang.Iterable + values) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pscAutoConnections_); + onChanged(); + } else { + pscAutoConnectionsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder clearPscAutoConnections() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnections_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00080000); + onChanged(); + } else { + pscAutoConnectionsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public Builder removePscAutoConnections(int index) { + if (pscAutoConnectionsBuilder_ == null) { + ensurePscAutoConnectionsIsMutable(); + pscAutoConnections_.remove(index); + onChanged(); + } else { + pscAutoConnectionsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder + getPscAutoConnectionsBuilder(int index) { + return getPscAutoConnectionsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder + getPscAutoConnectionsOrBuilder(int index) { + if (pscAutoConnectionsBuilder_ == null) { + return pscAutoConnections_.get(index); + } else { + return pscAutoConnectionsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getPscAutoConnectionsOrBuilderList() { + if (pscAutoConnectionsBuilder_ != null) { + return pscAutoConnectionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(pscAutoConnections_); + } + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder + addPscAutoConnectionsBuilder() { + return getPscAutoConnectionsFieldBuilder() + .addBuilder(com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder + addPscAutoConnectionsBuilder(int index) { + return getPscAutoConnectionsFieldBuilder() + .addBuilder( + index, com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance()); + } + /** + * + * + *
+     * Required. Immutable. User inputs and resource details of the auto-created
+     * PSC connections.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + public java.util.List + getPscAutoConnectionsBuilderList() { + return getPscAutoConnectionsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscAutoConnection, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder> + getPscAutoConnectionsFieldBuilder() { + if (pscAutoConnectionsBuilder_ == null) { + pscAutoConnectionsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PscAutoConnection, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder, + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder>( + pscAutoConnections_, + ((bitField0_ & 0x00080000) != 0), + getParentForChildren(), + isClean()); + pscAutoConnections_ = null; + } + return pscAutoConnectionsBuilder_; + } + + private java.util.List + endpoints_ = java.util.Collections.emptyList(); + + private void ensureEndpointsIsMutable() { + if (!((bitField0_ & 0x00100000) != 0)) { + endpoints_ = + new java.util.ArrayList( + endpoints_); + bitField0_ |= 0x00100000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder> + endpointsBuilder_; + + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getEndpointsList() { + if (endpointsBuilder_ == null) { + return java.util.Collections.unmodifiableList(endpoints_); + } else { + return endpointsBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public int getEndpointsCount() { + if (endpointsBuilder_ == null) { + return endpoints_.size(); + } else { + return endpointsBuilder_.getCount(); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint getEndpoints(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEndpoints( + int index, com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.set(index, value); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setEndpoints( + int index, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.set(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(value); + onChanged(); + } else { + endpointsBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints( + int index, com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint value) { + if (endpointsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureEndpointsIsMutable(); + endpoints_.add(index, value); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addEndpoints( + int index, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder builderForValue) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.add(index, builderForValue.build()); + onChanged(); + } else { + endpointsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder addAllEndpoints( + java.lang.Iterable + values) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, endpoints_); + onChanged(); + } else { + endpointsBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearEndpoints() { + if (endpointsBuilder_ == null) { + endpoints_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00100000); + onChanged(); + } else { + endpointsBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder removeEndpoints(int index) { + if (endpointsBuilder_ == null) { + ensureEndpointsIsMutable(); + endpoints_.remove(index); + onChanged(); + } else { + endpointsBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder + getEndpointsBuilder(int index) { + return getEndpointsFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder + getEndpointsOrBuilder(int index) { + if (endpointsBuilder_ == null) { + return endpoints_.get(index); + } else { + return endpointsBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List< + ? extends com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder> + getEndpointsOrBuilderList() { + if (endpointsBuilder_ != null) { + return endpointsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(endpoints_); + } + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder + addEndpointsBuilder() { + return getEndpointsFieldBuilder() + .addBuilder( + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder + addEndpointsBuilder(int index) { + return getEndpointsFieldBuilder() + .addBuilder( + index, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.getDefaultInstance()); + } + /** + * + * + *
+     * Optional. Endpoints for the instance.
+     * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public java.util.List + getEndpointsBuilderList() { + return getEndpointsFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder> + getEndpointsFieldBuilder() { + if (endpointsBuilder_ == null) { + endpointsBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint.Builder, + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder>( + endpoints_, ((bitField0_ & 0x00100000) != 0), getParentForChildren(), isClean()); + endpoints_ = null; + } + return endpointsBuilder_; + } + + private int mode_ = 0; + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00200000; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance.Mode getMode() { + com.google.cloud.memorystore.v1beta.Instance.Mode result = + com.google.cloud.memorystore.v1beta.Instance.Mode.forNumber(mode_); + return result == null + ? com.google.cloud.memorystore.v1beta.Instance.Mode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode(com.google.cloud.memorystore.v1beta.Instance.Mode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00200000; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The mode config for the instance.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00200000); + mode_ = 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.memorystore.v1beta.Instance) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.Instance) + private static final com.google.cloud.memorystore.v1beta.Instance DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.Instance(); + } + + public static com.google.cloud.memorystore.v1beta.Instance getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Instance parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/InstanceName.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/InstanceName.java new file mode 100644 index 000000000000..58a69fd4e8f7 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/InstanceName.java @@ -0,0 +1,223 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class InstanceName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION_INSTANCE = + PathTemplate.createWithoutUrlEncoding( + "projects/{project}/locations/{location}/instances/{instance}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + private final String instance; + + @Deprecated + protected InstanceName() { + project = null; + location = null; + instance = null; + } + + private InstanceName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + instance = Preconditions.checkNotNull(builder.getInstance()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static InstanceName of(String project, String location, String instance) { + return newBuilder().setProject(project).setLocation(location).setInstance(instance).build(); + } + + public static String format(String project, String location, String instance) { + return newBuilder() + .setProject(project) + .setLocation(location) + .setInstance(instance) + .build() + .toString(); + } + + public static InstanceName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION_INSTANCE.validatedMatch( + formattedString, "InstanceName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location"), matchMap.get("instance")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (InstanceName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION_INSTANCE.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + if (instance != null) { + fieldMapBuilder.put("instance", instance); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION_INSTANCE.instantiate( + "project", project, "location", location, "instance", instance); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + InstanceName that = ((InstanceName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location) + && Objects.equals(this.instance, that.instance); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + h *= 1000003; + h ^= Objects.hashCode(instance); + return h; + } + + /** Builder for projects/{project}/locations/{location}/instances/{instance}. */ + public static class Builder { + private String project; + private String location; + private String instance; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public String getInstance() { + return instance; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + public Builder setInstance(String instance) { + this.instance = instance; + return this; + } + + private Builder(InstanceName instanceName) { + this.project = instanceName.project; + this.location = instanceName.location; + this.instance = instanceName.instance; + } + + public InstanceName build() { + return new InstanceName(this); + } + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/InstanceOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/InstanceOrBuilder.java new file mode 100644 index 000000000000..79c205b1dbbe --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/InstanceOrBuilder.java @@ -0,0 +1,887 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface InstanceOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.Instance) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The name. + */ + java.lang.String getName(); + /** + * + * + *
+   * Identifier. Unique name of the instance.
+   * Format: projects/{project}/locations/{location}/instances/{instance}
+   * 
+ * + * string name = 1 [(.google.api.field_behavior) = IDENTIFIER]; + * + * @return The bytes for name. + */ + com.google.protobuf.ByteString getNameBytes(); + + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the createTime field is set. + */ + boolean hasCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The createTime. + */ + com.google.protobuf.Timestamp getCreateTime(); + /** + * + * + *
+   * Output only. Creation timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp create_time = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder(); + + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the updateTime field is set. + */ + boolean hasUpdateTime(); + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The updateTime. + */ + com.google.protobuf.Timestamp getUpdateTime(); + /** + * + * + *
+   * Output only. Latest update timestamp of the instance.
+   * 
+ * + * .google.protobuf.Timestamp update_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder(); + + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + int getLabelsCount(); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + boolean containsLabels(java.lang.String key); + /** Use {@link #getLabelsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getLabels(); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.util.Map getLabelsMap(); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + /* nullable */ + java.lang.String getLabelsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. Labels to represent user-provided metadata.
+   * 
+ * + * map<string, string> labels = 4 [(.google.api.field_behavior) = OPTIONAL]; + */ + java.lang.String getLabelsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for state. + */ + int getStateValue(); + /** + * + * + *
+   * Output only. Current state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.State state = 5 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The state. + */ + com.google.cloud.memorystore.v1beta.Instance.State getState(); + + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the stateInfo field is set. + */ + boolean hasStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The stateInfo. + */ + com.google.cloud.memorystore.v1beta.Instance.StateInfo getStateInfo(); + /** + * + * + *
+   * Output only. Additional information about the state of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.StateInfo state_info = 6 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1beta.Instance.StateInfoOrBuilder getStateInfoOrBuilder(); + + /** + * + * + *
+   * Output only. System assigned, unique identifier for the instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The uid. + */ + java.lang.String getUid(); + /** + * + * + *
+   * Output only. System assigned, unique identifier for the instance.
+   * 
+ * + * + * string uid = 7 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for uid. + */ + com.google.protobuf.ByteString getUidBytes(); + + /** + * + * + *
+   * Optional. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return Whether the replicaCount field is set. + */ + boolean hasReplicaCount(); + /** + * + * + *
+   * Optional. Number of replica nodes per shard. If omitted the default is 0
+   * replicas.
+   * 
+ * + * optional int32 replica_count = 8 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The replicaCount. + */ + int getReplicaCount(); + + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for authorizationMode. + */ + int getAuthorizationModeValue(); + /** + * + * + *
+   * Optional. Immutable. Authorization mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.AuthorizationMode authorization_mode = 9 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The authorizationMode. + */ + com.google.cloud.memorystore.v1beta.Instance.AuthorizationMode getAuthorizationMode(); + + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for transitEncryptionMode. + */ + int getTransitEncryptionModeValue(); + /** + * + * + *
+   * Optional. Immutable. In-transit encryption mode of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode transit_encryption_mode = 10 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The transitEncryptionMode. + */ + com.google.cloud.memorystore.v1beta.Instance.TransitEncryptionMode getTransitEncryptionMode(); + + /** + * + * + *
+   * Optional. Number of shards for the instance.
+   * 
+ * + * int32 shard_count = 11 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The shardCount. + */ + int getShardCount(); + + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List getDiscoveryEndpointsList(); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1beta.DiscoveryEndpoint getDiscoveryEndpoints(int index); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + int getDiscoveryEndpointsCount(); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + java.util.List + getDiscoveryEndpointsOrBuilderList(); + /** + * + * + *
+   * Output only. Endpoints clients can connect to the instance through.
+   * Currently only one discovery endpoint is supported.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.DiscoveryEndpoint discovery_endpoints = 12 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1beta.DiscoveryEndpointOrBuilder getDiscoveryEndpointsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The enum numeric value on the wire for nodeType. + */ + int getNodeTypeValue(); + /** + * + * + *
+   * Optional. Immutable. Machine type for individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.NodeType node_type = 13 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The nodeType. + */ + com.google.cloud.memorystore.v1beta.Instance.NodeType getNodeType(); + + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the persistenceConfig field is set. + */ + boolean hasPersistenceConfig(); + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The persistenceConfig. + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig getPersistenceConfig(); + /** + * + * + *
+   * Optional. Persistence configuration of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig persistence_config = 14 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1beta.PersistenceConfigOrBuilder getPersistenceConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The engineVersion. + */ + java.lang.String getEngineVersion(); + /** + * + * + *
+   * Optional. Immutable. Engine version of the instance.
+   * 
+ * + * + * string engine_version = 15 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The bytes for engineVersion. + */ + com.google.protobuf.ByteString getEngineVersionBytes(); + + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getEngineConfigsCount(); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + boolean containsEngineConfigs(java.lang.String key); + /** Use {@link #getEngineConfigsMap()} instead. */ + @java.lang.Deprecated + java.util.Map getEngineConfigs(); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.Map getEngineConfigsMap(); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + /* nullable */ + java.lang.String getEngineConfigsOrDefault( + java.lang.String key, + /* nullable */ + java.lang.String defaultValue); + /** + * + * + *
+   * Optional. User-provided engine configurations for the instance.
+   * 
+ * + * map<string, string> engine_configs = 16 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.lang.String getEngineConfigsOrThrow(java.lang.String key); + + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return Whether the nodeConfig field is set. + */ + boolean hasNodeConfig(); + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The nodeConfig. + */ + com.google.cloud.memorystore.v1beta.NodeConfig getNodeConfig(); + /** + * + * + *
+   * Output only. Configuration of individual nodes of the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.NodeConfig node_config = 17 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + */ + com.google.cloud.memorystore.v1beta.NodeConfigOrBuilder getNodeConfigOrBuilder(); + + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return Whether the zoneDistributionConfig field is set. + */ + boolean hasZoneDistributionConfig(); + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + * + * @return The zoneDistributionConfig. + */ + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig getZoneDistributionConfig(); + /** + * + * + *
+   * Optional. Immutable. Zone distribution configuration of the instance for
+   * node allocation.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig zone_distribution_config = 18 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.memorystore.v1beta.ZoneDistributionConfigOrBuilder + getZoneDistributionConfigOrBuilder(); + + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the deletionProtectionEnabled field is set. + */ + boolean hasDeletionProtectionEnabled(); + /** + * + * + *
+   * Optional. If set to true deletion of the instance will fail.
+   * 
+ * + * optional bool deletion_protection_enabled = 19 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The deletionProtectionEnabled. + */ + boolean getDeletionProtectionEnabled(); + + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List getPscAutoConnectionsList(); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.memorystore.v1beta.PscAutoConnection getPscAutoConnections(int index); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + int getPscAutoConnectionsCount(); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + java.util.List + getPscAutoConnectionsOrBuilderList(); + /** + * + * + *
+   * Required. Immutable. User inputs and resource details of the auto-created
+   * PSC connections.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.PscAutoConnection psc_auto_connections = 20 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE]; + * + */ + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder getPscAutoConnectionsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List getEndpointsList(); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpoint getEndpoints(int index); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + int getEndpointsCount(); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + java.util.List + getEndpointsOrBuilderList(); + /** + * + * + *
+   * Optional. Endpoints for the instance.
+   * 
+ * + * + * repeated .google.cloud.memorystore.v1beta.Instance.InstanceEndpoint endpoints = 25 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1beta.Instance.InstanceEndpointOrBuilder getEndpointsOrBuilder( + int index); + + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. The mode config for the instance.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance.Mode mode = 26 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.memorystore.v1beta.Instance.Mode getMode(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesRequest.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesRequest.java new file mode 100644 index 000000000000..36b7451b63b1 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesRequest.java @@ -0,0 +1,1297 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Request message for [ListInstances][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.ListInstancesRequest} + */ +public final class ListInstancesRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.ListInstancesRequest) + ListInstancesRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesRequest.newBuilder() to construct. + private ListInstancesRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesRequest() { + parent_ = ""; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.ListInstancesRequest.class, + com.google.cloud.memorystore.v1beta.ListInstancesRequest.Builder.class); + } + + public static final int PARENT_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object parent_ = ""; + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + @java.lang.Override + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + @java.lang.Override + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_ = 0; + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int PAGE_TOKEN_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object pageToken_ = ""; + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPageTokenBytes() { + java.lang.Object ref = pageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + pageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FILTER_FIELD_NUMBER = 4; + + @SuppressWarnings("serial") + private volatile java.lang.Object filter_ = ""; + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + @java.lang.Override + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + @java.lang.Override + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ORDER_BY_FIELD_NUMBER = 5; + + @SuppressWarnings("serial") + private volatile java.lang.Object orderBy_ = ""; + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + @java.lang.Override + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + @java.lang.Override + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, parent_); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, orderBy_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(parent_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, parent_); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, pageSize_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, pageToken_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(filter_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, filter_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(orderBy_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, orderBy_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.ListInstancesRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.ListInstancesRequest other = + (com.google.cloud.memorystore.v1beta.ListInstancesRequest) obj; + + if (!getParent().equals(other.getParent())) return false; + if (getPageSize() != other.getPageSize()) return false; + if (!getPageToken().equals(other.getPageToken())) return false; + if (!getFilter().equals(other.getFilter())) return false; + if (!getOrderBy().equals(other.getOrderBy())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PARENT_FIELD_NUMBER; + hash = (53 * hash) + getParent().hashCode(); + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getPageToken().hashCode(); + hash = (37 * hash) + FILTER_FIELD_NUMBER; + hash = (53 * hash) + getFilter().hashCode(); + hash = (37 * hash) + ORDER_BY_FIELD_NUMBER; + hash = (53 * hash) + getOrderBy().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.ListInstancesRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [ListInstances][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.ListInstancesRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.ListInstancesRequest) + com.google.cloud.memorystore.v1beta.ListInstancesRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.ListInstancesRequest.class, + com.google.cloud.memorystore.v1beta.ListInstancesRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.ListInstancesRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + parent_ = ""; + pageSize_ = 0; + pageToken_ = ""; + filter_ = ""; + orderBy_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.ListInstancesRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesRequest build() { + com.google.cloud.memorystore.v1beta.ListInstancesRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesRequest buildPartial() { + com.google.cloud.memorystore.v1beta.ListInstancesRequest result = + new com.google.cloud.memorystore.v1beta.ListInstancesRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.ListInstancesRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.parent_ = parent_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pageSize_ = pageSize_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.pageToken_ = pageToken_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.filter_ = filter_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.orderBy_ = orderBy_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1beta.ListInstancesRequest) { + return mergeFrom((com.google.cloud.memorystore.v1beta.ListInstancesRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.ListInstancesRequest other) { + if (other == com.google.cloud.memorystore.v1beta.ListInstancesRequest.getDefaultInstance()) + return this; + if (!other.getParent().isEmpty()) { + parent_ = other.parent_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getPageToken().isEmpty()) { + pageToken_ = other.pageToken_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getFilter().isEmpty()) { + filter_ = other.filter_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getOrderBy().isEmpty()) { + orderBy_ = other.orderBy_; + bitField0_ |= 0x00000010; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + parent_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + pageSize_ = input.readInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 26: + { + pageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + case 34: + { + filter_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 34 + case 42: + { + orderBy_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 42 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object parent_ = ""; + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + public java.lang.String getParent() { + java.lang.Object ref = parent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + parent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + public com.google.protobuf.ByteString getParentBytes() { + java.lang.Object ref = parent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + parent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The parent to set. + * @return This builder for chaining. + */ + public Builder setParent(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearParent() { + parent_ = getDefaultInstance().getParent(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The parent to list instances from.
+     * Format: projects/{project}/locations/{location}
+     * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for parent to set. + * @return This builder for chaining. + */ + public Builder setParentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + parent_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int pageSize_; + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Requested page size. Server may return fewer items than
+     * requested. If unspecified, server will pick an appropriate default.
+     * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageSize() { + bitField0_ = (bitField0_ & ~0x00000002); + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object pageToken_ = ""; + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @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; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearPageToken() { + pageToken_ = getDefaultInstance().getPageToken(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. A token identifying a page of results the server should return.
+     * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for pageToken to set. + * @return This builder for chaining. + */ + public Builder setPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + pageToken_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object filter_ = ""; + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + public java.lang.String getFilter() { + java.lang.Object ref = filter_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + filter_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + public com.google.protobuf.ByteString getFilterBytes() { + java.lang.Object ref = filter_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + filter_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The filter to set. + * @return This builder for chaining. + */ + public Builder setFilter(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearFilter() { + filter_ = getDefaultInstance().getFilter(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Expression for filtering results.
+     * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for filter to set. + * @return This builder for chaining. + */ + public Builder setFilterBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + filter_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object orderBy_ = ""; + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + public java.lang.String getOrderBy() { + java.lang.Object ref = orderBy_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + orderBy_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + public com.google.protobuf.ByteString getOrderByBytes() { + java.lang.Object ref = orderBy_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + orderBy_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderBy(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearOrderBy() { + orderBy_ = getDefaultInstance().getOrderBy(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Sort results by a defined order. Supported values: "name",
+     * "create_time".
+     * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for orderBy to set. + * @return This builder for chaining. + */ + public Builder setOrderByBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + orderBy_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1beta.ListInstancesRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.ListInstancesRequest) + private static final com.google.cloud.memorystore.v1beta.ListInstancesRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.ListInstancesRequest(); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesRequestOrBuilder.java new file mode 100644 index 000000000000..99f2c87df05d --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesRequestOrBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface ListInstancesRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.ListInstancesRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The parent. + */ + java.lang.String getParent(); + /** + * + * + *
+   * Required. The parent to list instances from.
+   * Format: projects/{project}/locations/{location}
+   * 
+ * + * + * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for parent. + */ + com.google.protobuf.ByteString getParentBytes(); + + /** + * + * + *
+   * Optional. Requested page size. Server may return fewer items than
+   * requested. If unspecified, server will pick an appropriate default.
+   * 
+ * + * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageSize. + */ + int getPageSize(); + + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The pageToken. + */ + java.lang.String getPageToken(); + /** + * + * + *
+   * Optional. A token identifying a page of results the server should return.
+   * 
+ * + * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for pageToken. + */ + com.google.protobuf.ByteString getPageTokenBytes(); + + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The filter. + */ + java.lang.String getFilter(); + /** + * + * + *
+   * Optional. Expression for filtering results.
+   * 
+ * + * string filter = 4 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for filter. + */ + com.google.protobuf.ByteString getFilterBytes(); + + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The orderBy. + */ + java.lang.String getOrderBy(); + /** + * + * + *
+   * Optional. Sort results by a defined order. Supported values: "name",
+   * "create_time".
+   * 
+ * + * string order_by = 5 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for orderBy. + */ + com.google.protobuf.ByteString getOrderByBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesResponse.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesResponse.java new file mode 100644 index 000000000000..e75d63ab60df --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesResponse.java @@ -0,0 +1,1451 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Response message for [ListInstances][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.ListInstancesResponse} + */ +public final class ListInstancesResponse extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.ListInstancesResponse) + ListInstancesResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListInstancesResponse.newBuilder() to construct. + private ListInstancesResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ListInstancesResponse() { + instances_ = java.util.Collections.emptyList(); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ListInstancesResponse(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.ListInstancesResponse.class, + com.google.cloud.memorystore.v1beta.ListInstancesResponse.Builder.class); + } + + public static final int INSTANCES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List instances_; + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + @java.lang.Override + public java.util.List getInstancesList() { + return instances_; + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + @java.lang.Override + public java.util.List + getInstancesOrBuilderList() { + return instances_; + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + @java.lang.Override + public int getInstancesCount() { + return instances_.size(); + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance getInstances(int index) { + return instances_.get(index); + } + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index) { + return instances_.get(index); + } + + public static final int NEXT_PAGE_TOKEN_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + @java.lang.Override + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } + } + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + 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 < instances_.size(); i++) { + output.writeMessage(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, nextPageToken_); + } + for (int i = 0; i < unreachable_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, unreachable_.getRaw(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < instances_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, instances_.get(i)); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(nextPageToken_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, nextPageToken_); + } + { + int dataSize = 0; + for (int i = 0; i < unreachable_.size(); i++) { + dataSize += computeStringSizeNoTag(unreachable_.getRaw(i)); + } + size += dataSize; + size += 1 * getUnreachableList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.ListInstancesResponse)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.ListInstancesResponse other = + (com.google.cloud.memorystore.v1beta.ListInstancesResponse) obj; + + if (!getInstancesList().equals(other.getInstancesList())) return false; + if (!getNextPageToken().equals(other.getNextPageToken())) return false; + if (!getUnreachableList().equals(other.getUnreachableList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getInstancesCount() > 0) { + hash = (37 * hash) + INSTANCES_FIELD_NUMBER; + hash = (53 * hash) + getInstancesList().hashCode(); + } + hash = (37 * hash) + NEXT_PAGE_TOKEN_FIELD_NUMBER; + hash = (53 * hash) + getNextPageToken().hashCode(); + if (getUnreachableCount() > 0) { + hash = (37 * hash) + UNREACHABLE_FIELD_NUMBER; + hash = (53 * hash) + getUnreachableList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.ListInstancesResponse prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Response message for [ListInstances][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.ListInstancesResponse} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.ListInstancesResponse) + com.google.cloud.memorystore.v1beta.ListInstancesResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.ListInstancesResponse.class, + com.google.cloud.memorystore.v1beta.ListInstancesResponse.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.ListInstancesResponse.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + } else { + instances_ = null; + instancesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + nextPageToken_ = ""; + unreachable_ = com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ListInstancesResponse_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesResponse getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.ListInstancesResponse.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesResponse build() { + com.google.cloud.memorystore.v1beta.ListInstancesResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesResponse buildPartial() { + com.google.cloud.memorystore.v1beta.ListInstancesResponse result = + new com.google.cloud.memorystore.v1beta.ListInstancesResponse(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + com.google.cloud.memorystore.v1beta.ListInstancesResponse result) { + if (instancesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + instances_ = java.util.Collections.unmodifiableList(instances_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.instances_ = instances_; + } else { + result.instances_ = instancesBuilder_.build(); + } + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.ListInstancesResponse 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.memorystore.v1beta.ListInstancesResponse) { + return mergeFrom((com.google.cloud.memorystore.v1beta.ListInstancesResponse) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.ListInstancesResponse other) { + if (other == com.google.cloud.memorystore.v1beta.ListInstancesResponse.getDefaultInstance()) + return this; + if (instancesBuilder_ == null) { + if (!other.instances_.isEmpty()) { + if (instances_.isEmpty()) { + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureInstancesIsMutable(); + instances_.addAll(other.instances_); + } + onChanged(); + } + } else { + if (!other.instances_.isEmpty()) { + if (instancesBuilder_.isEmpty()) { + instancesBuilder_.dispose(); + instancesBuilder_ = null; + instances_ = other.instances_; + bitField0_ = (bitField0_ & ~0x00000001); + instancesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getInstancesFieldBuilder() + : null; + } else { + instancesBuilder_.addAllMessages(other.instances_); + } + } + } + if (!other.getNextPageToken().isEmpty()) { + nextPageToken_ = other.nextPageToken_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.unreachable_.isEmpty()) { + if (unreachable_.isEmpty()) { + unreachable_ = other.unreachable_; + bitField0_ |= 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.memorystore.v1beta.Instance m = + input.readMessage( + com.google.cloud.memorystore.v1beta.Instance.parser(), extensionRegistry); + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(m); + } else { + instancesBuilder_.addMessage(m); + } + break; + } // case 10 + case 18: + { + nextPageToken_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + java.lang.String s = input.readStringRequireUtf8(); + ensureUnreachableIsMutable(); + unreachable_.add(s); + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List instances_ = + java.util.Collections.emptyList(); + + private void ensureInstancesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + instances_ = + new java.util.ArrayList(instances_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder> + instancesBuilder_; + + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public java.util.List getInstancesList() { + if (instancesBuilder_ == null) { + return java.util.Collections.unmodifiableList(instances_); + } else { + return instancesBuilder_.getMessageList(); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public int getInstancesCount() { + if (instancesBuilder_ == null) { + return instances_.size(); + } else { + return instancesBuilder_.getCount(); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1beta.Instance getInstances(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessage(index); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder setInstances(int index, com.google.cloud.memorystore.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.set(index, value); + onChanged(); + } else { + instancesBuilder_.setMessage(index, value); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder setInstances( + int index, com.google.cloud.memorystore.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.set(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder addInstances(com.google.cloud.memorystore.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(value); + onChanged(); + } else { + instancesBuilder_.addMessage(value); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder addInstances(int index, com.google.cloud.memorystore.v1beta.Instance value) { + if (instancesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureInstancesIsMutable(); + instances_.add(index, value); + onChanged(); + } else { + instancesBuilder_.addMessage(index, value); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder addInstances( + com.google.cloud.memorystore.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder addInstances( + int index, com.google.cloud.memorystore.v1beta.Instance.Builder builderForValue) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.add(index, builderForValue.build()); + onChanged(); + } else { + instancesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder addAllInstances( + java.lang.Iterable values) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, instances_); + onChanged(); + } else { + instancesBuilder_.addAllMessages(values); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder clearInstances() { + if (instancesBuilder_ == null) { + instances_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + instancesBuilder_.clear(); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public Builder removeInstances(int index) { + if (instancesBuilder_ == null) { + ensureInstancesIsMutable(); + instances_.remove(index); + onChanged(); + } else { + instancesBuilder_.remove(index); + } + return this; + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1beta.Instance.Builder getInstancesBuilder(int index) { + return getInstancesFieldBuilder().getBuilder(index); + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index) { + if (instancesBuilder_ == null) { + return instances_.get(index); + } else { + return instancesBuilder_.getMessageOrBuilder(index); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public java.util.List + getInstancesOrBuilderList() { + if (instancesBuilder_ != null) { + return instancesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(instances_); + } + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1beta.Instance.Builder addInstancesBuilder() { + return getInstancesFieldBuilder() + .addBuilder(com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public com.google.cloud.memorystore.v1beta.Instance.Builder addInstancesBuilder(int index) { + return getInstancesFieldBuilder() + .addBuilder(index, com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance()); + } + /** + * + * + *
+     * If the {location} requested was "-" the response contains a list of
+     * instances from all locations. Instances in unreachable locations will be
+     * omitted.
+     * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + public java.util.List + getInstancesBuilderList() { + return getInstancesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder> + getInstancesFieldBuilder() { + if (instancesBuilder_ == null) { + instancesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder>( + instances_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + instances_ = null; + } + return instancesBuilder_; + } + + private java.lang.Object nextPageToken_ = ""; + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + public java.lang.String getNextPageToken() { + java.lang.Object ref = nextPageToken_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nextPageToken_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + public com.google.protobuf.ByteString getNextPageTokenBytes() { + java.lang.Object ref = nextPageToken_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + nextPageToken_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageToken(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + nextPageToken_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @return This builder for chaining. + */ + public Builder clearNextPageToken() { + nextPageToken_ = getDefaultInstance().getNextPageToken(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * A token, which can be sent as `page_token` to retrieve the next page.
+     * If this field is omitted, there are no subsequent pages.
+     * 
+ * + * string next_page_token = 2; + * + * @param value The bytes for nextPageToken to set. + * @return This builder for chaining. + */ + public Builder setNextPageTokenBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + nextPageToken_ = value; + 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.memorystore.v1beta.ListInstancesResponse) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.ListInstancesResponse) + private static final com.google.cloud.memorystore.v1beta.ListInstancesResponse DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.ListInstancesResponse(); + } + + public static com.google.cloud.memorystore.v1beta.ListInstancesResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListInstancesResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ListInstancesResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesResponseOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesResponseOrBuilder.java new file mode 100644 index 000000000000..2fbe38450437 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ListInstancesResponseOrBuilder.java @@ -0,0 +1,166 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface ListInstancesResponseOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.ListInstancesResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + java.util.List getInstancesList(); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + com.google.cloud.memorystore.v1beta.Instance getInstances(int index); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + int getInstancesCount(); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + java.util.List + getInstancesOrBuilderList(); + /** + * + * + *
+   * If the {location} requested was "-" the response contains a list of
+   * instances from all locations. Instances in unreachable locations will be
+   * omitted.
+   * 
+ * + * repeated .google.cloud.memorystore.v1beta.Instance instances = 1; + */ + com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstancesOrBuilder(int index); + + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The nextPageToken. + */ + java.lang.String getNextPageToken(); + /** + * + * + *
+   * A token, which can be sent as `page_token` to retrieve the next page.
+   * If this field is omitted, there are no subsequent pages.
+   * 
+ * + * string next_page_token = 2; + * + * @return The bytes for nextPageToken. + */ + com.google.protobuf.ByteString getNextPageTokenBytes(); + + /** + * + * + *
+   * 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-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/LocationName.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/LocationName.java new file mode 100644 index 000000000000..ff612f6087da --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/LocationName.java @@ -0,0 +1,192 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta; + +import com.google.api.pathtemplate.PathTemplate; +import com.google.api.resourcenames.ResourceName; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import javax.annotation.Generated; + +// AUTO-GENERATED DOCUMENTATION AND CLASS. +@Generated("by gapic-generator-java") +public class LocationName implements ResourceName { + private static final PathTemplate PROJECT_LOCATION = + PathTemplate.createWithoutUrlEncoding("projects/{project}/locations/{location}"); + private volatile Map fieldValuesMap; + private final String project; + private final String location; + + @Deprecated + protected LocationName() { + project = null; + location = null; + } + + private LocationName(Builder builder) { + project = Preconditions.checkNotNull(builder.getProject()); + location = Preconditions.checkNotNull(builder.getLocation()); + } + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public Builder toBuilder() { + return new Builder(this); + } + + public static LocationName of(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build(); + } + + public static String format(String project, String location) { + return newBuilder().setProject(project).setLocation(location).build().toString(); + } + + public static LocationName parse(String formattedString) { + if (formattedString.isEmpty()) { + return null; + } + Map matchMap = + PROJECT_LOCATION.validatedMatch( + formattedString, "LocationName.parse: formattedString not in valid format"); + return of(matchMap.get("project"), matchMap.get("location")); + } + + public static List parseList(List formattedStrings) { + List list = new ArrayList<>(formattedStrings.size()); + for (String formattedString : formattedStrings) { + list.add(parse(formattedString)); + } + return list; + } + + public static List toStringList(List values) { + List list = new ArrayList<>(values.size()); + for (LocationName value : values) { + if (value == null) { + list.add(""); + } else { + list.add(value.toString()); + } + } + return list; + } + + public static boolean isParsableFrom(String formattedString) { + return PROJECT_LOCATION.matches(formattedString); + } + + @Override + public Map getFieldValuesMap() { + if (fieldValuesMap == null) { + synchronized (this) { + if (fieldValuesMap == null) { + ImmutableMap.Builder fieldMapBuilder = ImmutableMap.builder(); + if (project != null) { + fieldMapBuilder.put("project", project); + } + if (location != null) { + fieldMapBuilder.put("location", location); + } + fieldValuesMap = fieldMapBuilder.build(); + } + } + } + return fieldValuesMap; + } + + public String getFieldValue(String fieldName) { + return getFieldValuesMap().get(fieldName); + } + + @Override + public String toString() { + return PROJECT_LOCATION.instantiate("project", project, "location", location); + } + + @Override + public boolean equals(Object o) { + if (o == this) { + return true; + } + if (o != null && getClass() == o.getClass()) { + LocationName that = ((LocationName) o); + return Objects.equals(this.project, that.project) + && Objects.equals(this.location, that.location); + } + return false; + } + + @Override + public int hashCode() { + int h = 1; + h *= 1000003; + h ^= Objects.hashCode(project); + h *= 1000003; + h ^= Objects.hashCode(location); + return h; + } + + /** Builder for projects/{project}/locations/{location}. */ + public static class Builder { + private String project; + private String location; + + protected Builder() {} + + public String getProject() { + return project; + } + + public String getLocation() { + return location; + } + + public Builder setProject(String project) { + this.project = project; + return this; + } + + public Builder setLocation(String location) { + this.location = location; + return this; + } + + private Builder(LocationName locationName) { + this.project = locationName.project; + this.location = locationName.location; + } + + public LocationName build() { + return new LocationName(this); + } + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/NodeConfig.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/NodeConfig.java new file mode 100644 index 000000000000..dcf65f9177d2 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/NodeConfig.java @@ -0,0 +1,537 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Represents configuration for nodes of the instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.NodeConfig} + */ +public final class NodeConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.NodeConfig) + NodeConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use NodeConfig.newBuilder() to construct. + private NodeConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private NodeConfig() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new NodeConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_NodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_NodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.NodeConfig.class, + com.google.cloud.memorystore.v1beta.NodeConfig.Builder.class); + } + + public static final int SIZE_GB_FIELD_NUMBER = 1; + private double sizeGb_ = 0D; + /** + * + * + *
+   * Output only. Memory size in GB of the node.
+   * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public double getSizeGb() { + return sizeGb_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (java.lang.Double.doubleToRawLongBits(sizeGb_) != 0) { + output.writeDouble(1, sizeGb_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (java.lang.Double.doubleToRawLongBits(sizeGb_) != 0) { + size += com.google.protobuf.CodedOutputStream.computeDoubleSize(1, sizeGb_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.NodeConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.NodeConfig other = + (com.google.cloud.memorystore.v1beta.NodeConfig) obj; + + if (java.lang.Double.doubleToLongBits(getSizeGb()) + != java.lang.Double.doubleToLongBits(other.getSizeGb())) return false; + if (!getUnknownFields().equals(other.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) + SIZE_GB_FIELD_NUMBER; + hash = + (53 * hash) + + com.google.protobuf.Internal.hashLong(java.lang.Double.doubleToLongBits(getSizeGb())); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom(java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder(com.google.cloud.memorystore.v1beta.NodeConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 configuration for nodes of the instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.NodeConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.NodeConfig) + com.google.cloud.memorystore.v1beta.NodeConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_NodeConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_NodeConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.NodeConfig.class, + com.google.cloud.memorystore.v1beta.NodeConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.NodeConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + sizeGb_ = 0D; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_NodeConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.NodeConfig getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.NodeConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.NodeConfig build() { + com.google.cloud.memorystore.v1beta.NodeConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.NodeConfig buildPartial() { + com.google.cloud.memorystore.v1beta.NodeConfig result = + new com.google.cloud.memorystore.v1beta.NodeConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.NodeConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.sizeGb_ = sizeGb_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1beta.NodeConfig) { + return mergeFrom((com.google.cloud.memorystore.v1beta.NodeConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.NodeConfig other) { + if (other == com.google.cloud.memorystore.v1beta.NodeConfig.getDefaultInstance()) return this; + if (other.getSizeGb() != 0D) { + setSizeGb(other.getSizeGb()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 9: + { + sizeGb_ = input.readDouble(); + bitField0_ |= 0x00000001; + break; + } // case 9 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 double sizeGb_; + /** + * + * + *
+     * Output only. Memory size in GB of the node.
+     * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + @java.lang.Override + public double getSizeGb() { + return sizeGb_; + } + /** + * + * + *
+     * Output only. Memory size in GB of the node.
+     * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @param value The sizeGb to set. + * @return This builder for chaining. + */ + public Builder setSizeGb(double value) { + + sizeGb_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Memory size in GB of the node.
+     * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return This builder for chaining. + */ + public Builder clearSizeGb() { + bitField0_ = (bitField0_ & ~0x00000001); + sizeGb_ = 0D; + 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.memorystore.v1beta.NodeConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.NodeConfig) + private static final com.google.cloud.memorystore.v1beta.NodeConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.NodeConfig(); + } + + public static com.google.cloud.memorystore.v1beta.NodeConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public NodeConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.NodeConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/NodeConfigOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/NodeConfigOrBuilder.java new file mode 100644 index 000000000000..b0b5a41f3162 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/NodeConfigOrBuilder.java @@ -0,0 +1,39 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface NodeConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.NodeConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Output only. Memory size in GB of the node.
+   * 
+ * + * double size_gb = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * @return The sizeGb. + */ + double getSizeGb(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/OperationMetadata.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/OperationMetadata.java new file mode 100644 index 000000000000..558c67768e4f --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/OperationMetadata.java @@ -0,0 +1,1849 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Represents the metadata of a long-running operation.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.OperationMetadata} + */ +public final class OperationMetadata extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.OperationMetadata) + OperationMetadataOrBuilder { + private static final long serialVersionUID = 0L; + // Use OperationMetadata.newBuilder() to construct. + private OperationMetadata(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private OperationMetadata() { + target_ = ""; + verb_ = ""; + statusMessage_ = ""; + apiVersion_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new OperationMetadata(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.OperationMetadata.class, + com.google.cloud.memorystore.v1beta.OperationMetadata.Builder.class); + } + + private int bitField0_; + 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 ((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. + */ + @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 ((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. + */ + @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 been cancelled successfully
+   * 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCreateTime()); + } + if (((bitField0_ & 0x00000002) != 0)) { + 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.memorystore.v1beta.OperationMetadata)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.OperationMetadata other = + (com.google.cloud.memorystore.v1beta.OperationMetadata) obj; + + if (hasCreateTime() != other.hasCreateTime()) return false; + if (hasCreateTime()) { + if (!getCreateTime().equals(other.getCreateTime())) return false; + } + if (hasEndTime() != other.hasEndTime()) return false; + if (hasEndTime()) { + if (!getEndTime().equals(other.getEndTime())) return false; + } + if (!getTarget().equals(other.getTarget())) return false; + if (!getVerb().equals(other.getVerb())) return false; + if (!getStatusMessage().equals(other.getStatusMessage())) return false; + if (getRequestedCancellation() != other.getRequestedCancellation()) return false; + if (!getApiVersion().equals(other.getApiVersion())) return false; + if (!getUnknownFields().equals(other.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.memorystore.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.OperationMetadata prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Represents the metadata of a long-running operation.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.OperationMetadata} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.OperationMetadata) + com.google.cloud.memorystore.v1beta.OperationMetadataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_OperationMetadata_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.OperationMetadata.class, + com.google.cloud.memorystore.v1beta.OperationMetadata.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.OperationMetadata.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getCreateTimeFieldBuilder(); + getEndTimeFieldBuilder(); + } + } + + @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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_OperationMetadata_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.OperationMetadata getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.OperationMetadata.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.OperationMetadata build() { + com.google.cloud.memorystore.v1beta.OperationMetadata result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.OperationMetadata buildPartial() { + com.google.cloud.memorystore.v1beta.OperationMetadata result = + new com.google.cloud.memorystore.v1beta.OperationMetadata(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.OperationMetadata result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.createTime_ = createTimeBuilder_ == null ? createTime_ : createTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.endTime_ = endTimeBuilder_ == null ? endTime_ : endTimeBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + 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_; + } + 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.memorystore.v1beta.OperationMetadata) { + return mergeFrom((com.google.cloud.memorystore.v1beta.OperationMetadata) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.OperationMetadata other) { + if (other == com.google.cloud.memorystore.v1beta.OperationMetadata.getDefaultInstance()) + return this; + if (other.hasCreateTime()) { + mergeCreateTime(other.getCreateTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (!other.getTarget().isEmpty()) { + target_ = other.target_; + bitField0_ |= 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); + } + if (createTime_ != null) { + 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); + } + if (endTime_ != null) { + 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 been cancelled successfully
+     * 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 been cancelled successfully
+     * 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 been cancelled successfully
+     * 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.memorystore.v1beta.OperationMetadata) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.OperationMetadata) + private static final com.google.cloud.memorystore.v1beta.OperationMetadata DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.OperationMetadata(); + } + + public static com.google.cloud.memorystore.v1beta.OperationMetadata getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public OperationMetadata parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.OperationMetadata getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/OperationMetadataOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/OperationMetadataOrBuilder.java new file mode 100644 index 000000000000..584a4aa9eded --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/OperationMetadataOrBuilder.java @@ -0,0 +1,219 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface OperationMetadataOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.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 been cancelled successfully
+   * 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-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PersistenceConfig.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PersistenceConfig.java new file mode 100644 index 000000000000..da24bee2c46f --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PersistenceConfig.java @@ -0,0 +1,3488 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Represents persistence configuration for a instance.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PersistenceConfig} + */ +public final class PersistenceConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.PersistenceConfig) + PersistenceConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use PersistenceConfig.newBuilder() to construct. + private PersistenceConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PersistenceConfig() { + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PersistenceConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PersistenceConfig.class, + com.google.cloud.memorystore.v1beta.PersistenceConfig.Builder.class); + } + + /** + * + * + *
+   * Possible persistence modes.
+   * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode} + */ + public enum PersistenceMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not set.
+     * 
+ * + * PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + PERSISTENCE_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Persistence is disabled, and any snapshot data is deleted.
+     * 
+ * + * DISABLED = 1; + */ + DISABLED(1), + /** + * + * + *
+     * RDB based persistence is enabled.
+     * 
+ * + * RDB = 2; + */ + RDB(2), + /** + * + * + *
+     * AOF based persistence is enabled.
+     * 
+ * + * AOF = 3; + */ + AOF(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not set.
+     * 
+ * + * PERSISTENCE_MODE_UNSPECIFIED = 0; + */ + public static final int PERSISTENCE_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Persistence is disabled, and any snapshot data is deleted.
+     * 
+ * + * DISABLED = 1; + */ + public static final int DISABLED_VALUE = 1; + /** + * + * + *
+     * RDB based persistence is enabled.
+     * 
+ * + * RDB = 2; + */ + public static final int RDB_VALUE = 2; + /** + * + * + *
+     * AOF based persistence is enabled.
+     * 
+ * + * AOF = 3; + */ + public static final int AOF_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static PersistenceMode 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 PersistenceMode forNumber(int value) { + switch (value) { + case 0: + return PERSISTENCE_MODE_UNSPECIFIED; + case 1: + return DISABLED; + case 2: + return RDB; + case 3: + return AOF; + 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 PersistenceMode findValueByNumber(int number) { + return PersistenceMode.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.memorystore.v1beta.PersistenceConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final PersistenceMode[] VALUES = values(); + + public static PersistenceMode 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 PersistenceMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode) + } + + public interface RDBConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for rdbSnapshotPeriod. + */ + int getRdbSnapshotPeriodValue(); + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotPeriod. + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + getRdbSnapshotPeriod(); + + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbSnapshotStartTime field is set. + */ + boolean hasRdbSnapshotStartTime(); + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotStartTime. + */ + com.google.protobuf.Timestamp getRdbSnapshotStartTime(); + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.TimestampOrBuilder getRdbSnapshotStartTimeOrBuilder(); + } + /** + * + * + *
+   * Configuration for RDB based persistence.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig} + */ + public static final class RDBConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig) + RDBConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use RDBConfig.newBuilder() to construct. + private RDBConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private RDBConfig() { + rdbSnapshotPeriod_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new RDBConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_RDBConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_RDBConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.class, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.Builder.class); + } + + /** + * + * + *
+     * Possible snapshot periods.
+     * 
+ * + * Protobuf enum {@code + * google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod} + */ + public enum SnapshotPeriod implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not set.
+       * 
+ * + * SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + SNAPSHOT_PERIOD_UNSPECIFIED(0), + /** + * + * + *
+       * One hour.
+       * 
+ * + * ONE_HOUR = 1; + */ + ONE_HOUR(1), + /** + * + * + *
+       * Six hours.
+       * 
+ * + * SIX_HOURS = 2; + */ + SIX_HOURS(2), + /** + * + * + *
+       * Twelve hours.
+       * 
+ * + * TWELVE_HOURS = 3; + */ + TWELVE_HOURS(3), + /** + * + * + *
+       * Twenty four hours.
+       * 
+ * + * TWENTY_FOUR_HOURS = 4; + */ + TWENTY_FOUR_HOURS(4), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not set.
+       * 
+ * + * SNAPSHOT_PERIOD_UNSPECIFIED = 0; + */ + public static final int SNAPSHOT_PERIOD_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * One hour.
+       * 
+ * + * ONE_HOUR = 1; + */ + public static final int ONE_HOUR_VALUE = 1; + /** + * + * + *
+       * Six hours.
+       * 
+ * + * SIX_HOURS = 2; + */ + public static final int SIX_HOURS_VALUE = 2; + /** + * + * + *
+       * Twelve hours.
+       * 
+ * + * TWELVE_HOURS = 3; + */ + public static final int TWELVE_HOURS_VALUE = 3; + /** + * + * + *
+       * Twenty four hours.
+       * 
+ * + * TWENTY_FOUR_HOURS = 4; + */ + public static final int TWENTY_FOUR_HOURS_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 SnapshotPeriod 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 SnapshotPeriod forNumber(int value) { + switch (value) { + case 0: + return SNAPSHOT_PERIOD_UNSPECIFIED; + case 1: + return ONE_HOUR; + case 2: + return SIX_HOURS; + case 3: + return TWELVE_HOURS; + case 4: + return TWENTY_FOUR_HOURS; + 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 SnapshotPeriod findValueByNumber(int number) { + return SnapshotPeriod.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.memorystore.v1beta.PersistenceConfig.RDBConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final SnapshotPeriod[] VALUES = values(); + + public static SnapshotPeriod 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 SnapshotPeriod(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod) + } + + private int bitField0_; + public static final int RDB_SNAPSHOT_PERIOD_FIELD_NUMBER = 1; + private int rdbSnapshotPeriod_ = 0; + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for rdbSnapshotPeriod. + */ + @java.lang.Override + public int getRdbSnapshotPeriodValue() { + return rdbSnapshotPeriod_; + } + /** + * + * + *
+     * Optional. Period between RDB snapshots.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotPeriod. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + getRdbSnapshotPeriod() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod result = + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod.forNumber( + rdbSnapshotPeriod_); + return result == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + .UNRECOGNIZED + : result; + } + + public static final int RDB_SNAPSHOT_START_TIME_FIELD_NUMBER = 2; + private com.google.protobuf.Timestamp rdbSnapshotStartTime_; + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbSnapshotStartTime field is set. + */ + @java.lang.Override + public boolean hasRdbSnapshotStartTime() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotStartTime. + */ + @java.lang.Override + public com.google.protobuf.Timestamp getRdbSnapshotStartTime() { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } + /** + * + * + *
+     * Optional. Time that the first snapshot was/will be attempted, and to
+     * which future snapshots will be aligned. If not provided, the current time
+     * will be used.
+     * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.TimestampOrBuilder getRdbSnapshotStartTimeOrBuilder() { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (rdbSnapshotPeriod_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + .SNAPSHOT_PERIOD_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, rdbSnapshotPeriod_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRdbSnapshotStartTime()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (rdbSnapshotPeriod_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + .SNAPSHOT_PERIOD_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, rdbSnapshotPeriod_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRdbSnapshotStartTime()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig other = + (com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig) obj; + + if (rdbSnapshotPeriod_ != other.rdbSnapshotPeriod_) return false; + if (hasRdbSnapshotStartTime() != other.hasRdbSnapshotStartTime()) return false; + if (hasRdbSnapshotStartTime()) { + if (!getRdbSnapshotStartTime().equals(other.getRdbSnapshotStartTime())) return false; + } + if (!getUnknownFields().equals(other.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) + RDB_SNAPSHOT_PERIOD_FIELD_NUMBER; + hash = (53 * hash) + rdbSnapshotPeriod_; + if (hasRdbSnapshotStartTime()) { + hash = (37 * hash) + RDB_SNAPSHOT_START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getRdbSnapshotStartTime().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for RDB based persistence.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig) + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_RDBConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_RDBConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.class, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRdbSnapshotStartTimeFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + rdbSnapshotPeriod_ = 0; + rdbSnapshotStartTime_ = null; + if (rdbSnapshotStartTimeBuilder_ != null) { + rdbSnapshotStartTimeBuilder_.dispose(); + rdbSnapshotStartTimeBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_RDBConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig build() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig buildPartial() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig result = + new com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.rdbSnapshotPeriod_ = rdbSnapshotPeriod_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rdbSnapshotStartTime_ = + rdbSnapshotStartTimeBuilder_ == null + ? rdbSnapshotStartTime_ + : rdbSnapshotStartTimeBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + 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.memorystore.v1beta.PersistenceConfig.RDBConfig) { + return mergeFrom((com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig other) { + if (other + == com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.getDefaultInstance()) + return this; + if (other.rdbSnapshotPeriod_ != 0) { + setRdbSnapshotPeriodValue(other.getRdbSnapshotPeriodValue()); + } + if (other.hasRdbSnapshotStartTime()) { + mergeRdbSnapshotStartTime(other.getRdbSnapshotStartTime()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + rdbSnapshotPeriod_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage( + getRdbSnapshotStartTimeFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int rdbSnapshotPeriod_ = 0; + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for rdbSnapshotPeriod. + */ + @java.lang.Override + public int getRdbSnapshotPeriodValue() { + return rdbSnapshotPeriod_; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for rdbSnapshotPeriod to set. + * @return This builder for chaining. + */ + public Builder setRdbSnapshotPeriodValue(int value) { + rdbSnapshotPeriod_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotPeriod. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + getRdbSnapshotPeriod() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod result = + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + .forNumber(rdbSnapshotPeriod_); + return result == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The rdbSnapshotPeriod to set. + * @return This builder for chaining. + */ + public Builder setRdbSnapshotPeriod( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + rdbSnapshotPeriod_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Period between RDB snapshots.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.SnapshotPeriod rdb_snapshot_period = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearRdbSnapshotPeriod() { + bitField0_ = (bitField0_ & ~0x00000001); + rdbSnapshotPeriod_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp rdbSnapshotStartTime_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + rdbSnapshotStartTimeBuilder_; + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbSnapshotStartTime field is set. + */ + public boolean hasRdbSnapshotStartTime() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbSnapshotStartTime. + */ + public com.google.protobuf.Timestamp getRdbSnapshotStartTime() { + if (rdbSnapshotStartTimeBuilder_ == null) { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } else { + return rdbSnapshotStartTimeBuilder_.getMessage(); + } + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbSnapshotStartTime(com.google.protobuf.Timestamp value) { + if (rdbSnapshotStartTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rdbSnapshotStartTime_ = value; + } else { + rdbSnapshotStartTimeBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbSnapshotStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (rdbSnapshotStartTimeBuilder_ == null) { + rdbSnapshotStartTime_ = builderForValue.build(); + } else { + rdbSnapshotStartTimeBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRdbSnapshotStartTime(com.google.protobuf.Timestamp value) { + if (rdbSnapshotStartTimeBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && rdbSnapshotStartTime_ != null + && rdbSnapshotStartTime_ != com.google.protobuf.Timestamp.getDefaultInstance()) { + getRdbSnapshotStartTimeBuilder().mergeFrom(value); + } else { + rdbSnapshotStartTime_ = value; + } + } else { + rdbSnapshotStartTimeBuilder_.mergeFrom(value); + } + if (rdbSnapshotStartTime_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRdbSnapshotStartTime() { + bitField0_ = (bitField0_ & ~0x00000002); + rdbSnapshotStartTime_ = null; + if (rdbSnapshotStartTimeBuilder_ != null) { + rdbSnapshotStartTimeBuilder_.dispose(); + rdbSnapshotStartTimeBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.Timestamp.Builder getRdbSnapshotStartTimeBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRdbSnapshotStartTimeFieldBuilder().getBuilder(); + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.TimestampOrBuilder getRdbSnapshotStartTimeOrBuilder() { + if (rdbSnapshotStartTimeBuilder_ != null) { + return rdbSnapshotStartTimeBuilder_.getMessageOrBuilder(); + } else { + return rdbSnapshotStartTime_ == null + ? com.google.protobuf.Timestamp.getDefaultInstance() + : rdbSnapshotStartTime_; + } + } + /** + * + * + *
+       * Optional. Time that the first snapshot was/will be attempted, and to
+       * which future snapshots will be aligned. If not provided, the current time
+       * will be used.
+       * 
+ * + * + * .google.protobuf.Timestamp rdb_snapshot_start_time = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder> + getRdbSnapshotStartTimeFieldBuilder() { + if (rdbSnapshotStartTimeBuilder_ == null) { + rdbSnapshotStartTimeBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, + com.google.protobuf.Timestamp.Builder, + com.google.protobuf.TimestampOrBuilder>( + getRdbSnapshotStartTime(), getParentForChildren(), isClean()); + rdbSnapshotStartTime_ = null; + } + return rdbSnapshotStartTimeBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig) + private static final com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig(); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RDBConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AOFConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for appendFsync. + */ + int getAppendFsyncValue(); + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The appendFsync. + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync getAppendFsync(); + } + /** + * + * + *
+   * Configuration for AOF based persistence.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig} + */ + public static final class AOFConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig) + AOFConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use AOFConfig.newBuilder() to construct. + private AOFConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AOFConfig() { + appendFsync_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AOFConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_AOFConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_AOFConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.class, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.Builder.class); + } + + /** + * + * + *
+     * Possible fsync modes.
+     * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync} + */ + public enum AppendFsync implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+       * Not set. Default: EVERY_SEC
+       * 
+ * + * APPEND_FSYNC_UNSPECIFIED = 0; + */ + APPEND_FSYNC_UNSPECIFIED(0), + /** + * + * + *
+       * Never fsync. Normally Linux will flush data every 30 seconds with this
+       * configuration, but it's up to the kernel's exact tuning.
+       * 
+ * + * NEVER = 1; + */ + NEVER(1), + /** + * + * + *
+       * Fsync every second. You may lose 1 second of data if there is a
+       * disaster.
+       * 
+ * + * EVERY_SEC = 2; + */ + EVERY_SEC(2), + /** + * + * + *
+       * Fsync every time new write commands are appended to the AOF. The best
+       * data loss protection at the cost of performance.
+       * 
+ * + * ALWAYS = 3; + */ + ALWAYS(3), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+       * Not set. Default: EVERY_SEC
+       * 
+ * + * APPEND_FSYNC_UNSPECIFIED = 0; + */ + public static final int APPEND_FSYNC_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+       * Never fsync. Normally Linux will flush data every 30 seconds with this
+       * configuration, but it's up to the kernel's exact tuning.
+       * 
+ * + * NEVER = 1; + */ + public static final int NEVER_VALUE = 1; + /** + * + * + *
+       * Fsync every second. You may lose 1 second of data if there is a
+       * disaster.
+       * 
+ * + * EVERY_SEC = 2; + */ + public static final int EVERY_SEC_VALUE = 2; + /** + * + * + *
+       * Fsync every time new write commands are appended to the AOF. The best
+       * data loss protection at the cost of performance.
+       * 
+ * + * ALWAYS = 3; + */ + public static final int ALWAYS_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static AppendFsync 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 AppendFsync forNumber(int value) { + switch (value) { + case 0: + return APPEND_FSYNC_UNSPECIFIED; + case 1: + return NEVER; + case 2: + return EVERY_SEC; + case 3: + return ALWAYS; + 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 AppendFsync findValueByNumber(int number) { + return AppendFsync.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.memorystore.v1beta.PersistenceConfig.AOFConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final AppendFsync[] VALUES = values(); + + public static AppendFsync 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 AppendFsync(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync) + } + + public static final int APPEND_FSYNC_FIELD_NUMBER = 1; + private int appendFsync_ = 0; + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for appendFsync. + */ + @java.lang.Override + public int getAppendFsyncValue() { + return appendFsync_; + } + /** + * + * + *
+     * Optional. The fsync mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The appendFsync. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync + getAppendFsync() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync result = + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync.forNumber( + appendFsync_); + return result == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (appendFsync_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync + .APPEND_FSYNC_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, appendFsync_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (appendFsync_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync + .APPEND_FSYNC_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, appendFsync_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig other = + (com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig) obj; + + if (appendFsync_ != other.appendFsync_) return false; + if (!getUnknownFields().equals(other.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) + APPEND_FSYNC_FIELD_NUMBER; + hash = (53 * hash) + appendFsync_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig + parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+     * Configuration for AOF based persistence.
+     * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig} + */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig) + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_AOFConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_AOFConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.class, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.Builder.class); + } + + // Construct using + // com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + appendFsync_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_AOFConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig + getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig build() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig buildPartial() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig result = + new com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.appendFsync_ = appendFsync_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig) { + return mergeFrom((com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig other) { + if (other + == com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.getDefaultInstance()) + return this; + if (other.appendFsync_ != 0) { + setAppendFsyncValue(other.getAppendFsyncValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + appendFsync_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int appendFsync_ = 0; + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for appendFsync. + */ + @java.lang.Override + public int getAppendFsyncValue() { + return appendFsync_; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for appendFsync to set. + * @return This builder for chaining. + */ + public Builder setAppendFsyncValue(int value) { + appendFsync_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The appendFsync. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync + getAppendFsync() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync result = + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync.forNumber( + appendFsync_); + return result == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync + .UNRECOGNIZED + : result; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The appendFsync to set. + * @return This builder for chaining. + */ + public Builder setAppendFsync( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + appendFsync_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+       * Optional. The fsync mode.
+       * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.AppendFsync append_fsync = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearAppendFsync() { + bitField0_ = (bitField0_ & ~0x00000001); + appendFsync_ = 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.memorystore.v1beta.PersistenceConfig.AOFConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig) + private static final com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig(); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AOFConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private int bitField0_; + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode getMode() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode result = + com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode.forNumber(mode_); + return result == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode.UNRECOGNIZED + : result; + } + + public static final int RDB_CONFIG_FIELD_NUMBER = 2; + private com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdbConfig_; + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbConfig field is set. + */ + @java.lang.Override + public boolean hasRdbConfig() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig getRdbConfig() { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfigOrBuilder + getRdbConfigOrBuilder() { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } + + public static final int AOF_CONFIG_FIELD_NUMBER = 3; + private com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aofConfig_; + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the aofConfig field is set. + */ + @java.lang.Override + public boolean hasAofConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The aofConfig. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig getAofConfig() { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfigOrBuilder + getAofConfigOrBuilder() { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + 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 (mode_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode + .PERSISTENCE_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(2, getRdbConfig()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(3, getAofConfig()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode + .PERSISTENCE_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getRdbConfig()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getAofConfig()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.PersistenceConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.PersistenceConfig other = + (com.google.cloud.memorystore.v1beta.PersistenceConfig) obj; + + if (mode_ != other.mode_) return false; + if (hasRdbConfig() != other.hasRdbConfig()) return false; + if (hasRdbConfig()) { + if (!getRdbConfig().equals(other.getRdbConfig())) return false; + } + if (hasAofConfig() != other.hasAofConfig()) return false; + if (hasAofConfig()) { + if (!getAofConfig().equals(other.getAofConfig())) return false; + } + if (!getUnknownFields().equals(other.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) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + if (hasRdbConfig()) { + hash = (37 * hash) + RDB_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getRdbConfig().hashCode(); + } + if (hasAofConfig()) { + hash = (37 * hash) + AOF_CONFIG_FIELD_NUMBER; + hash = (53 * hash) + getAofConfig().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.PersistenceConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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 persistence configuration for a instance.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PersistenceConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.PersistenceConfig) + com.google.cloud.memorystore.v1beta.PersistenceConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PersistenceConfig.class, + com.google.cloud.memorystore.v1beta.PersistenceConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.PersistenceConfig.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getRdbConfigFieldBuilder(); + getAofConfigFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + mode_ = 0; + rdbConfig_ = null; + if (rdbConfigBuilder_ != null) { + rdbConfigBuilder_.dispose(); + rdbConfigBuilder_ = null; + } + aofConfig_ = null; + if (aofConfigBuilder_ != null) { + aofConfigBuilder_.dispose(); + aofConfigBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.PersistenceConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig build() { + com.google.cloud.memorystore.v1beta.PersistenceConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig buildPartial() { + com.google.cloud.memorystore.v1beta.PersistenceConfig result = + new com.google.cloud.memorystore.v1beta.PersistenceConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.PersistenceConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.mode_ = mode_; + } + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.rdbConfig_ = rdbConfigBuilder_ == null ? rdbConfig_ : rdbConfigBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.aofConfig_ = aofConfigBuilder_ == null ? aofConfig_ : aofConfigBuilder_.build(); + 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.memorystore.v1beta.PersistenceConfig) { + return mergeFrom((com.google.cloud.memorystore.v1beta.PersistenceConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.PersistenceConfig other) { + if (other == com.google.cloud.memorystore.v1beta.PersistenceConfig.getDefaultInstance()) + return this; + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + if (other.hasRdbConfig()) { + mergeRdbConfig(other.getRdbConfig()); + } + if (other.hasAofConfig()) { + mergeAofConfig(other.getAofConfig()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 18: + { + input.readMessage(getRdbConfigFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + input.readMessage(getAofConfigFieldBuilder().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 int mode_ = 0; + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode getMode() { + com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode result = + com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode.forNumber(mode_); + return result == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current persistence mode.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000001); + mode_ = 0; + onChanged(); + return this; + } + + private com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdbConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfigOrBuilder> + rdbConfigBuilder_; + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbConfig field is set. + */ + public boolean hasRdbConfig() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbConfig. + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig getRdbConfig() { + if (rdbConfigBuilder_ == null) { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } else { + return rdbConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig value) { + if (rdbConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + rdbConfig_ = value; + } else { + rdbConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setRdbConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.Builder builderForValue) { + if (rdbConfigBuilder_ == null) { + rdbConfig_ = builderForValue.build(); + } else { + rdbConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeRdbConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig value) { + if (rdbConfigBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && rdbConfig_ != null + && rdbConfig_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig + .getDefaultInstance()) { + getRdbConfigBuilder().mergeFrom(value); + } else { + rdbConfig_ = value; + } + } else { + rdbConfigBuilder_.mergeFrom(value); + } + if (rdbConfig_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearRdbConfig() { + bitField0_ = (bitField0_ & ~0x00000002); + rdbConfig_ = null; + if (rdbConfigBuilder_ != null) { + rdbConfigBuilder_.dispose(); + rdbConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.Builder + getRdbConfigBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getRdbConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfigOrBuilder + getRdbConfigOrBuilder() { + if (rdbConfigBuilder_ != null) { + return rdbConfigBuilder_.getMessageOrBuilder(); + } else { + return rdbConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.getDefaultInstance() + : rdbConfig_; + } + } + /** + * + * + *
+     * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfigOrBuilder> + getRdbConfigFieldBuilder() { + if (rdbConfigBuilder_ == null) { + rdbConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfigOrBuilder>( + getRdbConfig(), getParentForChildren(), isClean()); + rdbConfig_ = null; + } + return rdbConfigBuilder_; + } + + private com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aofConfig_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfigOrBuilder> + aofConfigBuilder_; + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the aofConfig field is set. + */ + public boolean hasAofConfig() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The aofConfig. + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig getAofConfig() { + if (aofConfigBuilder_ == null) { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } else { + return aofConfigBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAofConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig value) { + if (aofConfigBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + aofConfig_ = value; + } else { + aofConfigBuilder_.setMessage(value); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setAofConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.Builder builderForValue) { + if (aofConfigBuilder_ == null) { + aofConfig_ = builderForValue.build(); + } else { + aofConfigBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeAofConfig( + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig value) { + if (aofConfigBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0) + && aofConfig_ != null + && aofConfig_ + != com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig + .getDefaultInstance()) { + getAofConfigBuilder().mergeFrom(value); + } else { + aofConfig_ = value; + } + } else { + aofConfigBuilder_.mergeFrom(value); + } + if (aofConfig_ != null) { + bitField0_ |= 0x00000004; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearAofConfig() { + bitField0_ = (bitField0_ & ~0x00000004); + aofConfig_ = null; + if (aofConfigBuilder_ != null) { + aofConfigBuilder_.dispose(); + aofConfigBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.Builder + getAofConfigBuilder() { + bitField0_ |= 0x00000004; + onChanged(); + return getAofConfigFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfigOrBuilder + getAofConfigOrBuilder() { + if (aofConfigBuilder_ != null) { + return aofConfigBuilder_.getMessageOrBuilder(); + } else { + return aofConfig_ == null + ? com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.getDefaultInstance() + : aofConfig_; + } + } + /** + * + * + *
+     * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfigOrBuilder> + getAofConfigFieldBuilder() { + if (aofConfigBuilder_ == null) { + aofConfigBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig.Builder, + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfigOrBuilder>( + getAofConfig(), getParentForChildren(), isClean()); + aofConfig_ = null; + } + return aofConfigBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:google.cloud.memorystore.v1beta.PersistenceConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.PersistenceConfig) + private static final com.google.cloud.memorystore.v1beta.PersistenceConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.PersistenceConfig(); + } + + public static com.google.cloud.memorystore.v1beta.PersistenceConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PersistenceConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PersistenceConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PersistenceConfigOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PersistenceConfigOrBuilder.java new file mode 100644 index 000000000000..f3e5c0fcba0a --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PersistenceConfigOrBuilder.java @@ -0,0 +1,137 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface PersistenceConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.PersistenceConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. Current persistence mode.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig.PersistenceMode getMode(); + + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the rdbConfig field is set. + */ + boolean hasRdbConfig(); + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The rdbConfig. + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig getRdbConfig(); + /** + * + * + *
+   * Optional. RDB configuration. This field will be ignored if mode is not RDB.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfig rdb_config = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig.RDBConfigOrBuilder getRdbConfigOrBuilder(); + + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the aofConfig field is set. + */ + boolean hasAofConfig(); + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The aofConfig. + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig getAofConfig(); + /** + * + * + *
+   * Optional. AOF configuration. This field will be ignored if mode is not AOF.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfig aof_config = 3 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.cloud.memorystore.v1beta.PersistenceConfig.AOFConfigOrBuilder getAofConfigOrBuilder(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscAutoConnection.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscAutoConnection.java new file mode 100644 index 000000000000..c5731fdaf74a --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscAutoConnection.java @@ -0,0 +1,2242 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Details of consumer resources in a PSC connection.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PscAutoConnection} + */ +public final class PscAutoConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.PscAutoConnection) + PscAutoConnectionOrBuilder { + private static final long serialVersionUID = 0L; + // Use PscAutoConnection.newBuilder() to construct. + private PscAutoConnection(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private PscAutoConnection() { + pscConnectionId_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new PscAutoConnection(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscAutoConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscAutoConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PscAutoConnection.class, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder.class); + } + + private int portsCase_ = 0; + + @SuppressWarnings("serial") + private java.lang.Object ports_; + + public enum PortsCase + implements + com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + PORT(9), + PORTS_NOT_SET(0); + private final int value; + + private PortsCase(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 PortsCase valueOf(int value) { + return forNumber(value); + } + + public static PortsCase forNumber(int value) { + switch (value) { + case 9: + return PORT; + case 0: + return PORTS_NOT_SET; + default: + return null; + } + } + + public int getNumber() { + return this.value; + } + }; + + public PortsCase getPortsCase() { + return PortsCase.forNumber(portsCase_); + } + + public static final int PORT_FIELD_NUMBER = 9; + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the port field is set. + */ + @java.lang.Override + public boolean hasPort() { + return portsCase_ == 9; + } + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + if (portsCase_ == 9) { + return (java.lang.Integer) ports_; + } + return 0; + } + + 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 IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORWARDING_RULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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_ = ""; + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ = ""; + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ATTACHMENT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + @java.lang.Override + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } + } + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_CONNECTION_STATUS_FIELD_NUMBER = 7; + private int pscConnectionStatus_ = 0; + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1beta.PscConnectionStatus result = + com.google.cloud.memorystore.v1beta.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1beta.PscConnectionStatus.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_TYPE_FIELD_NUMBER = 8; + private int connectionType_ = 0; + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1beta.ConnectionType result = + com.google.cloud.memorystore.v1beta.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.memorystore.v1beta.ConnectionType.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pscConnectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1beta.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1beta.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, connectionType_); + } + if (portsCase_ == 9) { + output.writeInt32(9, (int) ((java.lang.Integer) ports_)); + } + 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(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1beta.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1beta.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, connectionType_); + } + if (portsCase_ == 9) { + size += + com.google.protobuf.CodedOutputStream.computeInt32Size( + 9, (int) ((java.lang.Integer) ports_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.PscAutoConnection)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.PscAutoConnection other = + (com.google.cloud.memorystore.v1beta.PscAutoConnection) obj; + + if (!getPscConnectionId().equals(other.getPscConnectionId())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getForwardingRule().equals(other.getForwardingRule())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getServiceAttachment().equals(other.getServiceAttachment())) return false; + if (pscConnectionStatus_ != other.pscConnectionStatus_) return false; + if (connectionType_ != other.connectionType_) return false; + if (!getPortsCase().equals(other.getPortsCase())) return false; + switch (portsCase_) { + case 9: + if (getPort() != other.getPort()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PSC_CONNECTION_ID_FIELD_NUMBER; + hash = (53 * hash) + getPscConnectionId().hashCode(); + hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().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 = (37 * hash) + SERVICE_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAttachment().hashCode(); + hash = (37 * hash) + PSC_CONNECTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + pscConnectionStatus_; + hash = (37 * hash) + CONNECTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + connectionType_; + switch (portsCase_) { + case 9: + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.PscAutoConnection prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new 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.memorystore.v1beta.PscAutoConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.PscAutoConnection) + com.google.cloud.memorystore.v1beta.PscAutoConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscAutoConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscAutoConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PscAutoConnection.class, + com.google.cloud.memorystore.v1beta.PscAutoConnection.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.PscAutoConnection.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + pscConnectionId_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + portsCase_ = 0; + ports_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscAutoConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnection getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnection build() { + com.google.cloud.memorystore.v1beta.PscAutoConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnection buildPartial() { + com.google.cloud.memorystore.v1beta.PscAutoConnection result = + new com.google.cloud.memorystore.v1beta.PscAutoConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.PscAutoConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.pscConnectionId_ = pscConnectionId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.forwardingRule_ = forwardingRule_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.serviceAttachment_ = serviceAttachment_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.pscConnectionStatus_ = pscConnectionStatus_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.connectionType_ = connectionType_; + } + } + + private void buildPartialOneofs(com.google.cloud.memorystore.v1beta.PscAutoConnection result) { + result.portsCase_ = portsCase_; + result.ports_ = this.ports_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1beta.PscAutoConnection) { + return mergeFrom((com.google.cloud.memorystore.v1beta.PscAutoConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.PscAutoConnection other) { + if (other == com.google.cloud.memorystore.v1beta.PscAutoConnection.getDefaultInstance()) + return this; + if (!other.getPscConnectionId().isEmpty()) { + pscConnectionId_ = other.pscConnectionId_; + bitField0_ |= 0x00000002; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + bitField0_ |= 0x00000004; + onChanged(); + } + if (!other.getForwardingRule().isEmpty()) { + forwardingRule_ = other.forwardingRule_; + bitField0_ |= 0x00000008; + onChanged(); + } + if (!other.getProjectId().isEmpty()) { + projectId_ = other.projectId_; + bitField0_ |= 0x00000010; + onChanged(); + } + if (!other.getNetwork().isEmpty()) { + network_ = other.network_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (!other.getServiceAttachment().isEmpty()) { + serviceAttachment_ = other.serviceAttachment_; + bitField0_ |= 0x00000040; + onChanged(); + } + if (other.pscConnectionStatus_ != 0) { + setPscConnectionStatusValue(other.getPscConnectionStatusValue()); + } + if (other.connectionType_ != 0) { + setConnectionTypeValue(other.getConnectionTypeValue()); + } + switch (other.getPortsCase()) { + case PORT: + { + setPort(other.getPort()); + break; + } + case PORTS_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: + { + pscConnectionId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 10 + case 18: + { + ipAddress_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 18 + case 26: + { + forwardingRule_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000008; + break; + } // case 26 + case 34: + { + projectId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000010; + break; + } // case 34 + case 42: + { + network_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 42 + case 50: + { + serviceAttachment_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000040; + break; + } // case 50 + case 56: + { + pscConnectionStatus_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 56 + case 64: + { + connectionType_ = input.readEnum(); + bitField0_ |= 0x00000100; + break; + } // case 64 + case 72: + { + ports_ = input.readInt32(); + portsCase_ = 9; + break; + } // case 72 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 portsCase_ = 0; + private java.lang.Object ports_; + + public PortsCase getPortsCase() { + return PortsCase.forNumber(portsCase_); + } + + public Builder clearPorts() { + portsCase_ = 0; + ports_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the port field is set. + */ + public boolean hasPort() { + return portsCase_ == 9; + } + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The port. + */ + public int getPort() { + if (portsCase_ == 9) { + return (java.lang.Integer) ports_; + } + return 0; + } + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + portsCase_ = 9; + ports_ = value; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Output only. port will only be set for Primary/Reader or
+     * Discovery endpoint.
+     * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearPort() { + if (portsCase_ == 9) { + portsCase_ = 0; + ports_ = null; + onChanged(); + } + return this; + } + + 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_ |= 0x00000002; + 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_ & ~0x00000002); + 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_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object ipAddress_ = ""; + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The IP allocated on the consumer network for the PSC
+     * forwarding rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + private java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearForwardingRule() { + forwardingRule_ = getDefaultInstance().getForwardingRule(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @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_ |= 0x00000008; + onChanged(); + return this; + } + + private java.lang.Object projectId_ = ""; + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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; + } + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return This builder for chaining. + */ + public Builder clearProjectId() { + projectId_ = getDefaultInstance().getProjectId(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer project_id where PSC connections are established.
+     * This should be the same project_id that the instance is being created in.
+     * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @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_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object network_ = ""; + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The network where the PSC endpoints are created, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAttachment_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServiceAttachment() { + serviceAttachment_ = getDefaultInstance().getServiceAttachment(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The service attachment which is the target of the PSC
+     * connection, in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAttachment_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + private int pscConnectionStatus_ = 0; + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatusValue(int value) { + pscConnectionStatus_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1beta.PscConnectionStatus result = + com.google.cloud.memorystore.v1beta.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1beta.PscConnectionStatus.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatus( + com.google.cloud.memorystore.v1beta.PscConnectionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + pscConnectionStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscConnectionStatus() { + bitField0_ = (bitField0_ & ~0x00000080); + pscConnectionStatus_ = 0; + onChanged(); + return this; + } + + private int connectionType_ = 0; + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionTypeValue(int value) { + connectionType_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1beta.ConnectionType result = + com.google.cloud.memorystore.v1beta.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.memorystore.v1beta.ConnectionType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionType(com.google.cloud.memorystore.v1beta.ConnectionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000100; + connectionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionType() { + bitField0_ = (bitField0_ & ~0x00000100); + connectionType_ = 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.memorystore.v1beta.PscAutoConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.PscAutoConnection) + private static final com.google.cloud.memorystore.v1beta.PscAutoConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.PscAutoConnection(); + } + + public static com.google.cloud.memorystore.v1beta.PscAutoConnection getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PscAutoConnection parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscAutoConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscAutoConnectionOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscAutoConnectionOrBuilder.java new file mode 100644 index 000000000000..b19c70518bf4 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscAutoConnectionOrBuilder.java @@ -0,0 +1,305 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface PscAutoConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.PscAutoConnection) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the port field is set. + */ + boolean hasPort(); + /** + * + * + *
+   * Optional. Output only. port will only be set for Primary/Reader or
+   * Discovery endpoint.
+   * 
+ * + * + * int32 port = 9 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The port. + */ + int getPort(); + + /** + * + * + *
+   * 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 ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Output only. The IP allocated on the consumer network for the PSC
+   * forwarding rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The forwardingRule. + */ + java.lang.String getForwardingRule(); + /** + * + * + *
+   * Output only. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for forwardingRule. + */ + com.google.protobuf.ByteString getForwardingRuleBytes(); + + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The projectId. + */ + java.lang.String getProjectId(); + /** + * + * + *
+   * Required. The consumer project_id where PSC connections are established.
+   * This should be the same project_id that the instance is being created in.
+   * 
+ * + * string project_id = 4 [(.google.api.field_behavior) = REQUIRED]; + * + * @return The bytes for projectId. + */ + com.google.protobuf.ByteString getProjectIdBytes(); + + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The network where the PSC endpoints are created, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + java.lang.String getServiceAttachment(); + /** + * + * + *
+   * Output only. The service attachment which is the target of the PSC
+   * connection, in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = OUTPUT_ONLY, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + com.google.protobuf.ByteString getServiceAttachmentBytes(); + + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + int getPscConnectionStatusValue(); + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + com.google.cloud.memorystore.v1beta.PscConnectionStatus getPscConnectionStatus(); + + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + int getConnectionTypeValue(); + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + com.google.cloud.memorystore.v1beta.ConnectionType getConnectionType(); + + com.google.cloud.memorystore.v1beta.PscAutoConnection.PortsCase getPortsCase(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnection.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnection.java new file mode 100644 index 000000000000..e0a69ee42774 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnection.java @@ -0,0 +1,2009 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * User created Psc connection configuration.
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PscConnection} + */ +public final class PscConnection extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.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_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + } + + @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.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PscConnection.class, + com.google.cloud.memorystore.v1beta.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 IP_ADDRESS_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object ipAddress_ = ""; + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + @java.lang.Override + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + @java.lang.Override + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int FORWARDING_RULE_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_ = ""; + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + @java.lang.Override + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + @java.lang.Override + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SERVICE_ATTACHMENT_FIELD_NUMBER = 6; + + @SuppressWarnings("serial") + private volatile java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + @java.lang.Override + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } + } + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + @java.lang.Override + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PSC_CONNECTION_STATUS_FIELD_NUMBER = 7; + private int pscConnectionStatus_ = 0; + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1beta.PscConnectionStatus result = + com.google.cloud.memorystore.v1beta.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1beta.PscConnectionStatus.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_TYPE_FIELD_NUMBER = 8; + private int connectionType_ = 0; + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1beta.ConnectionType result = + com.google.cloud.memorystore.v1beta.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.memorystore.v1beta.ConnectionType.UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(pscConnectionId_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pscConnectionId_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1beta.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + output.writeEnum(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1beta.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + output.writeEnum(8, connectionType_); + } + 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(ipAddress_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, ipAddress_); + } + 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_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(serviceAttachment_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, serviceAttachment_); + } + if (pscConnectionStatus_ + != com.google.cloud.memorystore.v1beta.PscConnectionStatus.PSC_CONNECTION_STATUS_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(7, pscConnectionStatus_); + } + if (connectionType_ + != com.google.cloud.memorystore.v1beta.ConnectionType.CONNECTION_TYPE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(8, connectionType_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.PscConnection)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.PscConnection other = + (com.google.cloud.memorystore.v1beta.PscConnection) obj; + + if (!getPscConnectionId().equals(other.getPscConnectionId())) return false; + if (!getIpAddress().equals(other.getIpAddress())) return false; + if (!getForwardingRule().equals(other.getForwardingRule())) return false; + if (!getProjectId().equals(other.getProjectId())) return false; + if (!getNetwork().equals(other.getNetwork())) return false; + if (!getServiceAttachment().equals(other.getServiceAttachment())) return false; + if (pscConnectionStatus_ != other.pscConnectionStatus_) return false; + if (connectionType_ != other.connectionType_) return false; + if (!getUnknownFields().equals(other.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) + IP_ADDRESS_FIELD_NUMBER; + hash = (53 * hash) + getIpAddress().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 = (37 * hash) + SERVICE_ATTACHMENT_FIELD_NUMBER; + hash = (53 * hash) + getServiceAttachment().hashCode(); + hash = (37 * hash) + PSC_CONNECTION_STATUS_FIELD_NUMBER; + hash = (53 * hash) + pscConnectionStatus_; + hash = (37 * hash) + CONNECTION_TYPE_FIELD_NUMBER; + hash = (53 * hash) + connectionType_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.PscConnection parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.PscConnection parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.PscConnection parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.PscConnection parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.PscConnection parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.PscConnection parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.PscConnection parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.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; + } + /** + * + * + *
+   * User created Psc connection configuration.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.PscConnection} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.PscConnection) + com.google.cloud.memorystore.v1beta.PscConnectionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscConnection_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscConnection_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.PscConnection.class, + com.google.cloud.memorystore.v1beta.PscConnection.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.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_ = ""; + ipAddress_ = ""; + forwardingRule_ = ""; + projectId_ = ""; + network_ = ""; + serviceAttachment_ = ""; + pscConnectionStatus_ = 0; + connectionType_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_PscConnection_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnection getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnection build() { + com.google.cloud.memorystore.v1beta.PscConnection result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnection buildPartial() { + com.google.cloud.memorystore.v1beta.PscConnection result = + new com.google.cloud.memorystore.v1beta.PscConnection(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.PscConnection result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.pscConnectionId_ = pscConnectionId_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ipAddress_ = ipAddress_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.forwardingRule_ = forwardingRule_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.projectId_ = projectId_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.network_ = network_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.serviceAttachment_ = serviceAttachment_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.pscConnectionStatus_ = pscConnectionStatus_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.connectionType_ = connectionType_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1beta.PscConnection) { + return mergeFrom((com.google.cloud.memorystore.v1beta.PscConnection) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.PscConnection other) { + if (other == com.google.cloud.memorystore.v1beta.PscConnection.getDefaultInstance()) + return this; + if (!other.getPscConnectionId().isEmpty()) { + pscConnectionId_ = other.pscConnectionId_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getIpAddress().isEmpty()) { + ipAddress_ = other.ipAddress_; + 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(); + } + if (!other.getServiceAttachment().isEmpty()) { + serviceAttachment_ = other.serviceAttachment_; + bitField0_ |= 0x00000020; + onChanged(); + } + if (other.pscConnectionStatus_ != 0) { + setPscConnectionStatusValue(other.getPscConnectionStatusValue()); + } + if (other.connectionType_ != 0) { + setConnectionTypeValue(other.getConnectionTypeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + ipAddress_ = 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 + case 50: + { + serviceAttachment_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000020; + break; + } // case 50 + case 56: + { + pscConnectionStatus_ = input.readEnum(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: + { + connectionType_ = input.readEnum(); + bitField0_ |= 0x00000080; + break; + } // case 64 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was 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 ipAddress_ = ""; + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + public java.lang.String getIpAddress() { + java.lang.Object ref = ipAddress_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ipAddress_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + public com.google.protobuf.ByteString getIpAddressBytes() { + java.lang.Object ref = ipAddress_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + ipAddress_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @param value The ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddress(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearIpAddress() { + ipAddress_ = getDefaultInstance().getIpAddress(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The IP allocated on the consumer network for the PSC forwarding
+     * rule.
+     * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @param value The bytes for ipAddress to set. + * @return This builder for chaining. + */ + public Builder setIpAddressBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ipAddress_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + private java.lang.Object forwardingRule_ = ""; + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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; + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearForwardingRule() { + forwardingRule_ = getDefaultInstance().getForwardingRule(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The URI of the consumer side forwarding rule.
+     * Format:
+     * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+     * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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_ = ""; + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + public java.lang.String getNetwork() { + java.lang.Object ref = network_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + network_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + public com.google.protobuf.ByteString getNetworkBytes() { + java.lang.Object ref = network_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + network_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The network to set. + * @return This builder for chaining. + */ + public Builder setNetwork(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + network_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearNetwork() { + network_ = getDefaultInstance().getNetwork(); + bitField0_ = (bitField0_ & ~0x00000010); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The consumer network where the IP address resides, in the form of
+     * projects/{project_id}/global/networks/{network_id}.
+     * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for network to set. + * @return This builder for chaining. + */ + public Builder setNetworkBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + network_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + private java.lang.Object serviceAttachment_ = ""; + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + public java.lang.String getServiceAttachment() { + java.lang.Object ref = serviceAttachment_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceAttachment_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + public com.google.protobuf.ByteString getServiceAttachmentBytes() { + java.lang.Object ref = serviceAttachment_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + serviceAttachment_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachment(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + serviceAttachment_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearServiceAttachment() { + serviceAttachment_ = getDefaultInstance().getServiceAttachment(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The service attachment which is the target of the PSC connection,
+     * in the form of
+     * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+     * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @param value The bytes for serviceAttachment to set. + * @return This builder for chaining. + */ + public Builder setServiceAttachmentBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + serviceAttachment_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + private int pscConnectionStatus_ = 0; + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + @java.lang.Override + public int getPscConnectionStatusValue() { + return pscConnectionStatus_; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatusValue(int value) { + pscConnectionStatus_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.PscConnectionStatus getPscConnectionStatus() { + com.google.cloud.memorystore.v1beta.PscConnectionStatus result = + com.google.cloud.memorystore.v1beta.PscConnectionStatus.forNumber(pscConnectionStatus_); + return result == null + ? com.google.cloud.memorystore.v1beta.PscConnectionStatus.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The pscConnectionStatus to set. + * @return This builder for chaining. + */ + public Builder setPscConnectionStatus( + com.google.cloud.memorystore.v1beta.PscConnectionStatus value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000040; + pscConnectionStatus_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. The status of the PSC connection: whether a connection exists
+     * and ACTIVE or it no longer exists. Please note that this value is updated
+     * periodically. Please use Private Service Connect APIs for the latest
+     * status.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearPscConnectionStatus() { + bitField0_ = (bitField0_ & ~0x00000040); + pscConnectionStatus_ = 0; + onChanged(); + return this; + } + + private int connectionType_ = 0; + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + @java.lang.Override + public int getConnectionTypeValue() { + return connectionType_; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The enum numeric value on the wire for connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionTypeValue(int value) { + connectionType_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ConnectionType getConnectionType() { + com.google.cloud.memorystore.v1beta.ConnectionType result = + com.google.cloud.memorystore.v1beta.ConnectionType.forNumber(connectionType_); + return result == null + ? com.google.cloud.memorystore.v1beta.ConnectionType.UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @param value The connectionType to set. + * @return This builder for chaining. + */ + public Builder setConnectionType(com.google.cloud.memorystore.v1beta.ConnectionType value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000080; + connectionType_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Output only. Type of the PSC connection.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return This builder for chaining. + */ + public Builder clearConnectionType() { + bitField0_ = (bitField0_ & ~0x00000080); + connectionType_ = 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.memorystore.v1beta.PscConnection) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.PscConnection) + private static final com.google.cloud.memorystore.v1beta.PscConnection DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.PscConnection(); + } + + public static com.google.cloud.memorystore.v1beta.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.memorystore.v1beta.PscConnection getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnectionOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnectionOrBuilder.java new file mode 100644 index 000000000000..a687a137e07b --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnectionOrBuilder.java @@ -0,0 +1,272 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface PscConnectionOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.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(); + + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The ipAddress. + */ + java.lang.String getIpAddress(); + /** + * + * + *
+   * Required. The IP allocated on the consumer network for the PSC forwarding
+   * rule.
+   * 
+ * + * + * string ip_address = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_info) = { ... } + * + * + * @return The bytes for ipAddress. + */ + com.google.protobuf.ByteString getIpAddressBytes(); + + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The forwardingRule. + */ + java.lang.String getForwardingRule(); + /** + * + * + *
+   * Required. The URI of the consumer side forwarding rule.
+   * Format:
+   * projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}
+   * 
+ * + * + * string forwarding_rule = 3 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @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(); + + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The network. + */ + java.lang.String getNetwork(); + /** + * + * + *
+   * Required. The consumer network where the IP address resides, in the form of
+   * projects/{project_id}/global/networks/{network_id}.
+   * 
+ * + * + * string network = 5 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for network. + */ + com.google.protobuf.ByteString getNetworkBytes(); + + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The serviceAttachment. + */ + java.lang.String getServiceAttachment(); + /** + * + * + *
+   * Required. The service attachment which is the target of the PSC connection,
+   * in the form of
+   * projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}.
+   * 
+ * + * + * string service_attachment = 6 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... } + * + * + * @return The bytes for serviceAttachment. + */ + com.google.protobuf.ByteString getServiceAttachmentBytes(); + + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for pscConnectionStatus. + */ + int getPscConnectionStatusValue(); + /** + * + * + *
+   * Output only. The status of the PSC connection: whether a connection exists
+   * and ACTIVE or it no longer exists. Please note that this value is updated
+   * periodically. Please use Private Service Connect APIs for the latest
+   * status.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.PscConnectionStatus psc_connection_status = 7 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The pscConnectionStatus. + */ + com.google.cloud.memorystore.v1beta.PscConnectionStatus getPscConnectionStatus(); + + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The enum numeric value on the wire for connectionType. + */ + int getConnectionTypeValue(); + /** + * + * + *
+   * Output only. Type of the PSC connection.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ConnectionType connection_type = 8 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * + * + * @return The connectionType. + */ + com.google.cloud.memorystore.v1beta.ConnectionType getConnectionType(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnectionStatus.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnectionStatus.java new file mode 100644 index 000000000000..e70ab19c2c51 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/PscConnectionStatus.java @@ -0,0 +1,180 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Status of the PSC connection.
+ * 
+ * + * Protobuf enum {@code google.cloud.memorystore.v1beta.PscConnectionStatus} + */ +public enum PscConnectionStatus implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+   * PSC connection status is not specified.
+   * 
+ * + * PSC_CONNECTION_STATUS_UNSPECIFIED = 0; + */ + PSC_CONNECTION_STATUS_UNSPECIFIED(0), + /** + * + * + *
+   * The connection is active
+   * 
+ * + * ACTIVE = 1; + */ + ACTIVE(1), + /** + * + * + *
+   * Connection not found
+   * 
+ * + * NOT_FOUND = 2; + */ + NOT_FOUND(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+   * PSC connection status is not specified.
+   * 
+ * + * PSC_CONNECTION_STATUS_UNSPECIFIED = 0; + */ + public static final int PSC_CONNECTION_STATUS_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+   * The connection is active
+   * 
+ * + * ACTIVE = 1; + */ + public static final int ACTIVE_VALUE = 1; + /** + * + * + *
+   * Connection not found
+   * 
+ * + * NOT_FOUND = 2; + */ + public static final int NOT_FOUND_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 PscConnectionStatus 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 PscConnectionStatus forNumber(int value) { + switch (value) { + case 0: + return PSC_CONNECTION_STATUS_UNSPECIFIED; + case 1: + return ACTIVE; + case 2: + return NOT_FOUND; + 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 PscConnectionStatus findValueByNumber(int number) { + return PscConnectionStatus.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.memorystore.v1beta.V1mainProto.getDescriptor().getEnumTypes().get(0); + } + + private static final PscConnectionStatus[] VALUES = values(); + + public static PscConnectionStatus 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 PscConnectionStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.PscConnectionStatus) +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/UpdateInstanceRequest.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/UpdateInstanceRequest.java new file mode 100644 index 000000000000..9d8c5a813af8 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/UpdateInstanceRequest.java @@ -0,0 +1,1316 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +/** + * + * + *
+ * Request message for [UpdateInstance][].
+ * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.UpdateInstanceRequest} + */ +public final class UpdateInstanceRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.UpdateInstanceRequest) + UpdateInstanceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UpdateInstanceRequest.newBuilder() to construct. + private UpdateInstanceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private UpdateInstanceRequest() { + requestId_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new UpdateInstanceRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest.class, + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest.Builder.class); + } + + private int bitField0_; + public static final int UPDATE_MASK_FIELD_NUMBER = 1; + private com.google.protobuf.FieldMask updateMask_; + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + @java.lang.Override + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + @java.lang.Override + public com.google.protobuf.FieldMask getUpdateMask() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + @java.lang.Override + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + return updateMask_ == null ? com.google.protobuf.FieldMask.getDefaultInstance() : updateMask_; + } + + public static final int INSTANCE_FIELD_NUMBER = 2; + private com.google.cloud.memorystore.v1beta.Instance instance_; + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + @java.lang.Override + public boolean hasInstance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.Instance getInstance() { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + + @SuppressWarnings("serial") + private volatile java.lang.Object requestId_ = ""; + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + @java.lang.Override + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeMessage(2, getInstance()); + } + 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 (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getUpdateMask()); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getInstance()); + } + 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.memorystore.v1beta.UpdateInstanceRequest)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest other = + (com.google.cloud.memorystore.v1beta.UpdateInstanceRequest) obj; + + if (hasUpdateMask() != other.hasUpdateMask()) return false; + if (hasUpdateMask()) { + if (!getUpdateMask().equals(other.getUpdateMask())) return false; + } + if (hasInstance() != other.hasInstance()) return false; + if (hasInstance()) { + if (!getInstance().equals(other.getInstance())) return false; + } + if (!getRequestId().equals(other.getRequestId())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasUpdateMask()) { + hash = (37 * hash) + UPDATE_MASK_FIELD_NUMBER; + hash = (53 * hash) + getUpdateMask().hashCode(); + } + if (hasInstance()) { + hash = (37 * hash) + INSTANCE_FIELD_NUMBER; + hash = (53 * hash) + getInstance().hashCode(); + } + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Request message for [UpdateInstance][].
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.UpdateInstanceRequest} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.UpdateInstanceRequest) + com.google.cloud.memorystore.v1beta.UpdateInstanceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_UpdateInstanceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest.class, + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.UpdateInstanceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + getUpdateMaskFieldBuilder(); + getInstanceFieldBuilder(); + } + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + requestId_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_UpdateInstanceRequest_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.UpdateInstanceRequest getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.UpdateInstanceRequest.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.UpdateInstanceRequest build() { + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.UpdateInstanceRequest buildPartial() { + com.google.cloud.memorystore.v1beta.UpdateInstanceRequest result = + new com.google.cloud.memorystore.v1beta.UpdateInstanceRequest(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.UpdateInstanceRequest result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.updateMask_ = updateMaskBuilder_ == null ? updateMask_ : updateMaskBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.instance_ = instanceBuilder_ == null ? instance_ : instanceBuilder_.build(); + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.requestId_ = requestId_; + } + 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.memorystore.v1beta.UpdateInstanceRequest) { + return mergeFrom((com.google.cloud.memorystore.v1beta.UpdateInstanceRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.UpdateInstanceRequest other) { + if (other == com.google.cloud.memorystore.v1beta.UpdateInstanceRequest.getDefaultInstance()) + return this; + if (other.hasUpdateMask()) { + mergeUpdateMask(other.getUpdateMask()); + } + if (other.hasInstance()) { + mergeInstance(other.getInstance()); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + bitField0_ |= 0x00000004; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + input.readMessage(getUpdateMaskFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + input.readMessage(getInstanceFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000002; + break; + } // case 18 + case 26: + { + requestId_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000004; + break; + } // case 26 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private com.google.protobuf.FieldMask updateMask_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + updateMaskBuilder_; + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + public boolean hasUpdateMask() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + public com.google.protobuf.FieldMask getUpdateMask() { + if (updateMaskBuilder_ == null) { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } else { + return updateMaskBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + updateMask_ = value; + } else { + updateMaskBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder setUpdateMask(com.google.protobuf.FieldMask.Builder builderForValue) { + if (updateMaskBuilder_ == null) { + updateMask_ = builderForValue.build(); + } else { + updateMaskBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder mergeUpdateMask(com.google.protobuf.FieldMask value) { + if (updateMaskBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) + && updateMask_ != null + && updateMask_ != com.google.protobuf.FieldMask.getDefaultInstance()) { + getUpdateMaskBuilder().mergeFrom(value); + } else { + updateMask_ = value; + } + } else { + updateMaskBuilder_.mergeFrom(value); + } + if (updateMask_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public Builder clearUpdateMask() { + bitField0_ = (bitField0_ & ~0x00000001); + updateMask_ = null; + if (updateMaskBuilder_ != null) { + updateMaskBuilder_.dispose(); + updateMaskBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMask.Builder getUpdateMaskBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getUpdateMaskFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + public com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder() { + if (updateMaskBuilder_ != null) { + return updateMaskBuilder_.getMessageOrBuilder(); + } else { + return updateMask_ == null + ? com.google.protobuf.FieldMask.getDefaultInstance() + : updateMask_; + } + } + /** + * + * + *
+     * Optional. The list of fields to be updated on the instance. At least one
+     * field must be specified.
+     * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder> + getUpdateMaskFieldBuilder() { + if (updateMaskBuilder_ == null) { + updateMaskBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.FieldMask, + com.google.protobuf.FieldMask.Builder, + com.google.protobuf.FieldMaskOrBuilder>( + getUpdateMask(), getParentForChildren(), isClean()); + updateMask_ = null; + } + return updateMaskBuilder_; + } + + private com.google.cloud.memorystore.v1beta.Instance instance_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder> + instanceBuilder_; + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + public boolean hasInstance() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + public com.google.cloud.memorystore.v1beta.Instance getInstance() { + if (instanceBuilder_ == null) { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } else { + return instanceBuilder_.getMessage(); + } + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance(com.google.cloud.memorystore.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + instance_ = value; + } else { + instanceBuilder_.setMessage(value); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder setInstance( + com.google.cloud.memorystore.v1beta.Instance.Builder builderForValue) { + if (instanceBuilder_ == null) { + instance_ = builderForValue.build(); + } else { + instanceBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder mergeInstance(com.google.cloud.memorystore.v1beta.Instance value) { + if (instanceBuilder_ == null) { + if (((bitField0_ & 0x00000002) != 0) + && instance_ != null + && instance_ != com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance()) { + getInstanceBuilder().mergeFrom(value); + } else { + instance_ = value; + } + } else { + instanceBuilder_.mergeFrom(value); + } + if (instance_ != null) { + bitField0_ |= 0x00000002; + onChanged(); + } + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public Builder clearInstance() { + bitField0_ = (bitField0_ & ~0x00000002); + instance_ = null; + if (instanceBuilder_ != null) { + instanceBuilder_.dispose(); + instanceBuilder_ = null; + } + onChanged(); + return this; + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1beta.Instance.Builder getInstanceBuilder() { + bitField0_ |= 0x00000002; + onChanged(); + return getInstanceFieldBuilder().getBuilder(); + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + public com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstanceOrBuilder() { + if (instanceBuilder_ != null) { + return instanceBuilder_.getMessageOrBuilder(); + } else { + return instance_ == null + ? com.google.cloud.memorystore.v1beta.Instance.getDefaultInstance() + : instance_; + } + } + /** + * + * + *
+     * Required. The instance to update.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder> + getInstanceFieldBuilder() { + if (instanceBuilder_ == null) { + instanceBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + com.google.cloud.memorystore.v1beta.Instance, + com.google.cloud.memorystore.v1beta.Instance.Builder, + com.google.cloud.memorystore.v1beta.InstanceOrBuilder>( + getInstance(), getParentForChildren(), isClean()); + instance_ = null; + } + return instanceBuilder_; + } + + private java.lang.Object requestId_ = ""; + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + public com.google.protobuf.ByteString getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @param value The requestId to set. + * @return This builder for chaining. + */ + public Builder setRequestId(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + requestId_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return This builder for chaining. + */ + public Builder clearRequestId() { + requestId_ = getDefaultInstance().getRequestId(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. An optional request ID to identify requests. Specify a unique
+     * request ID so that if you must retry your request, the server will know to
+     * ignore the request if it has already been completed. The server will
+     * guarantee that for at least 60 minutes since the first request.
+     *
+     * For example, consider a situation where you make an initial request and the
+     * request times out. If you make the request again with the same request
+     * ID, the server can check if original operation with the same request ID
+     * was received, and if so, will ignore the second request. This prevents
+     * clients from accidentally creating duplicate commitments.
+     *
+     * The request ID must be a valid UUID with the exception that zero UUID is
+     * not supported (00000000-0000-0000-0000-000000000000).
+     * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @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.memorystore.v1beta.UpdateInstanceRequest) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.UpdateInstanceRequest) + private static final com.google.cloud.memorystore.v1beta.UpdateInstanceRequest DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.UpdateInstanceRequest(); + } + + public static com.google.cloud.memorystore.v1beta.UpdateInstanceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UpdateInstanceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.UpdateInstanceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/UpdateInstanceRequestOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/UpdateInstanceRequestOrBuilder.java new file mode 100644 index 000000000000..88d4746bb8c4 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/UpdateInstanceRequestOrBuilder.java @@ -0,0 +1,161 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface UpdateInstanceRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.UpdateInstanceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return Whether the updateMask field is set. + */ + boolean hasUpdateMask(); + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The updateMask. + */ + com.google.protobuf.FieldMask getUpdateMask(); + /** + * + * + *
+   * Optional. The list of fields to be updated on the instance. At least one
+   * field must be specified.
+   * 
+ * + * .google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + */ + com.google.protobuf.FieldMaskOrBuilder getUpdateMaskOrBuilder(); + + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return Whether the instance field is set. + */ + boolean hasInstance(); + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + * + * @return The instance. + */ + com.google.cloud.memorystore.v1beta.Instance getInstance(); + /** + * + * + *
+   * Required. The instance to update.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.Instance instance = 2 [(.google.api.field_behavior) = REQUIRED]; + * + */ + com.google.cloud.memorystore.v1beta.InstanceOrBuilder getInstanceOrBuilder(); + + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The requestId. + */ + java.lang.String getRequestId(); + /** + * + * + *
+   * Optional. An optional request ID to identify requests. Specify a unique
+   * request ID so that if you must retry your request, the server will know to
+   * ignore the request if it has already been completed. The server will
+   * guarantee that for at least 60 minutes since the first request.
+   *
+   * For example, consider a situation where you make an initial request and the
+   * request times out. If you make the request again with the same request
+   * ID, the server can check if original operation with the same request ID
+   * was received, and if so, will ignore the second request. This prevents
+   * clients from accidentally creating duplicate commitments.
+   *
+   * The request ID must be a valid UUID with the exception that zero UUID is
+   * not supported (00000000-0000-0000-0000-000000000000).
+   * 
+ * + * + * string request_id = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_info) = { ... } + * + * + * @return The bytes for requestId. + */ + com.google.protobuf.ByteString getRequestIdBytes(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/V1mainProto.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/V1mainProto.java new file mode 100644 index 000000000000..93f846e56b80 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/V1mainProto.java @@ -0,0 +1,682 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public final class V1mainProto { + private V1mainProto() {} + + 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_memorystore_v1beta_Instance_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_Instance_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_UpdateInfo_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_Instance_StateInfo_UpdateInfo_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_Instance_InstanceEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_Instance_InstanceEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_Instance_ConnectionDetail_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_Instance_ConnectionDetail_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_Instance_LabelsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_Instance_LabelsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_Instance_EngineConfigsEntry_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_Instance_EngineConfigsEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_PscAutoConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_PscAutoConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_PscConnection_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_PscConnection_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_DiscoveryEndpoint_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_DiscoveryEndpoint_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_RDBConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_RDBConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_AOFConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_PersistenceConfig_AOFConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_NodeConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_NodeConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_ZoneDistributionConfig_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_ZoneDistributionConfig_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_ListInstancesRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_ListInstancesRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_ListInstancesResponse_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_ListInstancesResponse_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_GetInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_GetInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_CreateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_CreateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_UpdateInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_UpdateInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_DeleteInstanceRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_DeleteInstanceRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_GetCertificateAuthorityRequest_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_GetCertificateAuthorityRequest_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_CertChain_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_CertificateAuthority_ManagedCertificateAuthority_CertChain_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_cloud_memorystore_v1beta_OperationMetadata_descriptor; + static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_cloud_memorystore_v1beta_OperationMetadata_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + return descriptor; + } + + private static com.google.protobuf.Descriptors.FileDescriptor descriptor; + + static { + java.lang.String[] descriptorData = { + "\n1google/cloud/memorystore/v1beta/memory" + + "store.proto\022\037google.cloud.memorystore.v1" + + "beta\032\034google/api/annotations.proto\032\027goog" + + "le/api/client.proto\032\037google/api/field_be" + + "havior.proto\032\033google/api/field_info.prot" + + "o\032\031google/api/resource.proto\032#google/lon" + + "grunning/operations.proto\032\033google/protob" + + "uf/empty.proto\032 google/protobuf/field_ma" + + "sk.proto\032\037google/protobuf/timestamp.prot" + + "o\"\346\025\n\010Instance\022\021\n\004name\030\001 \001(\tB\003\340A\010\0224\n\013cre" + + "ate_time\030\002 \001(\0132\032.google.protobuf.Timesta" + + "mpB\003\340A\003\0224\n\013update_time\030\003 \001(\0132\032.google.pr" + + "otobuf.TimestampB\003\340A\003\022J\n\006labels\030\004 \003(\01325." + + "google.cloud.memorystore.v1beta.Instance" + + ".LabelsEntryB\003\340A\001\022C\n\005state\030\005 \001(\0162/.googl" + + "e.cloud.memorystore.v1beta.Instance.Stat" + + "eB\003\340A\003\022L\n\nstate_info\030\006 \001(\01323.google.clou" + + "d.memorystore.v1beta.Instance.StateInfoB" + + "\003\340A\003\022\030\n\003uid\030\007 \001(\tB\013\340A\003\342\214\317\327\010\002\010\001\022\037\n\rreplic" + + "a_count\030\010 \001(\005B\003\340A\001H\000\210\001\001\022_\n\022authorization" + + "_mode\030\t \001(\0162;.google.cloud.memorystore.v" + + "1beta.Instance.AuthorizationModeB\006\340A\001\340A\005" + + "\022h\n\027transit_encryption_mode\030\n \001(\0162?.goog" + + "le.cloud.memorystore.v1beta.Instance.Tra" + + "nsitEncryptionModeB\006\340A\001\340A\005\022\030\n\013shard_coun" + + "t\030\013 \001(\005B\003\340A\001\022T\n\023discovery_endpoints\030\014 \003(" + + "\01322.google.cloud.memorystore.v1beta.Disc" + + "overyEndpointB\003\340A\003\022M\n\tnode_type\030\r \001(\01622." + + "google.cloud.memorystore.v1beta.Instance" + + ".NodeTypeB\006\340A\001\340A\005\022S\n\022persistence_config\030" + + "\016 \001(\01322.google.cloud.memorystore.v1beta." + + "PersistenceConfigB\003\340A\001\022\036\n\016engine_version" + + "\030\017 \001(\tB\006\340A\001\340A\005\022Y\n\016engine_configs\030\020 \003(\0132<" + + ".google.cloud.memorystore.v1beta.Instanc" + + "e.EngineConfigsEntryB\003\340A\001\022E\n\013node_config" + + "\030\021 \001(\0132+.google.cloud.memorystore.v1beta" + + ".NodeConfigB\003\340A\003\022a\n\030zone_distribution_co" + + "nfig\030\022 \001(\01327.google.cloud.memorystore.v1" + + "beta.ZoneDistributionConfigB\006\340A\001\340A\005\022-\n\033d" + + "eletion_protection_enabled\030\023 \001(\010B\003\340A\001H\001\210" + + "\001\001\022X\n\024psc_auto_connections\030\024 \003(\01322.googl" + + "e.cloud.memorystore.v1beta.PscAutoConnec" + + "tionB\006\340A\002\340A\005\022R\n\tendpoints\030\031 \003(\0132:.google" + + ".cloud.memorystore.v1beta.Instance.Insta" + + "nceEndpointB\003\340A\001\022A\n\004mode\030\032 \001(\0162..google." + + "cloud.memorystore.v1beta.Instance.ModeB\003" + + "\340A\001\032\374\001\n\tStateInfo\022Z\n\013update_info\030\001 \001(\0132>" + + ".google.cloud.memorystore.v1beta.Instanc" + + "e.StateInfo.UpdateInfoB\003\340A\003H\000\032\212\001\n\nUpdate" + + "Info\022$\n\022target_shard_count\030\001 \001(\005B\003\340A\003H\000\210" + + "\001\001\022&\n\024target_replica_count\030\002 \001(\005B\003\340A\003H\001\210" + + "\001\001B\025\n\023_target_shard_countB\027\n\025_target_rep" + + "lica_countB\006\n\004info\032h\n\020InstanceEndpoint\022T" + + "\n\013connections\030\001 \003(\0132:.google.cloud.memor" + + "ystore.v1beta.Instance.ConnectionDetailB" + + "\003\340A\001\032\275\001\n\020ConnectionDetail\022Q\n\023psc_auto_co" + + "nnection\030\001 \001(\01322.google.cloud.memorystor" + + "e.v1beta.PscAutoConnectionH\000\022H\n\016psc_conn" + + "ection\030\002 \001(\0132..google.cloud.memorystore." + + "v1beta.PscConnectionH\000B\014\n\nconnection\032-\n\013" + + "LabelsEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:" + + "\0028\001\0324\n\022EngineConfigsEntry\022\013\n\003key\030\001 \001(\t\022\r" + + "\n\005value\030\002 \001(\t:\0028\001\"T\n\005State\022\025\n\021STATE_UNSP" + + "ECIFIED\020\000\022\014\n\010CREATING\020\001\022\n\n\006ACTIVE\020\002\022\014\n\010U" + + "PDATING\020\003\022\014\n\010DELETING\020\004\"X\n\021Authorization" + + "Mode\022\"\n\036AUTHORIZATION_MODE_UNSPECIFIED\020\000" + + "\022\021\n\rAUTH_DISABLED\020\001\022\014\n\010IAM_AUTH\020\002\"|\n\025Tra" + + "nsitEncryptionMode\022\'\n#TRANSIT_ENCRYPTION" + + "_MODE_UNSPECIFIED\020\000\022\037\n\033TRANSIT_ENCRYPTIO" + + "N_DISABLED\020\001\022\031\n\025SERVER_AUTHENTICATION\020\002\"" + + "w\n\010NodeType\022\031\n\025NODE_TYPE_UNSPECIFIED\020\000\022\024" + + "\n\020SHARED_CORE_NANO\020\001\022\022\n\016HIGHMEM_MEDIUM\020\002" + + "\022\022\n\016HIGHMEM_XLARGE\020\003\022\022\n\016STANDARD_SMALL\020\004" + + "\"9\n\004Mode\022\024\n\020MODE_UNSPECIFIED\020\000\022\016\n\nSTANDA" + + "LONE\020\001\022\013\n\007CLUSTER\020\002:{\352Ax\n#memorystore.go" + + "ogleapis.com/Instance\022 + * Zone distribution configuration for allocation of instance resources. + * + * + * Protobuf type {@code google.cloud.memorystore.v1beta.ZoneDistributionConfig} + */ +public final class ZoneDistributionConfig extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:google.cloud.memorystore.v1beta.ZoneDistributionConfig) + ZoneDistributionConfigOrBuilder { + private static final long serialVersionUID = 0L; + // Use ZoneDistributionConfig.newBuilder() to construct. + private ZoneDistributionConfig(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ZoneDistributionConfig() { + zone_ = ""; + mode_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ZoneDistributionConfig(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ZoneDistributionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ZoneDistributionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.class, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.Builder.class); + } + + /** + * + * + *
+   * Possible zone distribution modes.
+   * 
+ * + * Protobuf enum {@code + * google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode} + */ + public enum ZoneDistributionMode implements com.google.protobuf.ProtocolMessageEnum { + /** + * + * + *
+     * Not Set. Default: MULTI_ZONE
+     * 
+ * + * ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + */ + ZONE_DISTRIBUTION_MODE_UNSPECIFIED(0), + /** + * + * + *
+     * Distribute resources across 3 zones picked at random within the
+     * region.
+     * 
+ * + * MULTI_ZONE = 1; + */ + MULTI_ZONE(1), + /** + * + * + *
+     * Provision resources in a single zone. Zone field must be specified.
+     * 
+ * + * SINGLE_ZONE = 2; + */ + SINGLE_ZONE(2), + UNRECOGNIZED(-1), + ; + + /** + * + * + *
+     * Not Set. Default: MULTI_ZONE
+     * 
+ * + * ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + */ + public static final int ZONE_DISTRIBUTION_MODE_UNSPECIFIED_VALUE = 0; + /** + * + * + *
+     * Distribute resources across 3 zones picked at random within the
+     * region.
+     * 
+ * + * MULTI_ZONE = 1; + */ + public static final int MULTI_ZONE_VALUE = 1; + /** + * + * + *
+     * Provision resources in a single zone. Zone field must be specified.
+     * 
+ * + * SINGLE_ZONE = 2; + */ + public static final int SINGLE_ZONE_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 ZoneDistributionMode 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 ZoneDistributionMode forNumber(int value) { + switch (value) { + case 0: + return ZONE_DISTRIBUTION_MODE_UNSPECIFIED; + case 1: + return MULTI_ZONE; + case 2: + return SINGLE_ZONE; + 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 ZoneDistributionMode findValueByNumber(int number) { + return ZoneDistributionMode.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.memorystore.v1beta.ZoneDistributionConfig.getDescriptor() + .getEnumTypes() + .get(0); + } + + private static final ZoneDistributionMode[] VALUES = values(); + + public static ZoneDistributionMode 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 ZoneDistributionMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode) + } + + public static final int ZONE_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object zone_ = ""; + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The zone. + */ + @java.lang.Override + public java.lang.String getZone() { + java.lang.Object ref = zone_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zone_ = s; + return s; + } + } + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for zone. + */ + @java.lang.Override + public com.google.protobuf.ByteString getZoneBytes() { + java.lang.Object ref = zone_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODE_FIELD_NUMBER = 1; + private int mode_ = 0; + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode getMode() { + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode result = + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode.forNumber( + mode_); + return result == null + ? com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode + .UNRECOGNIZED + : result; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (mode_ + != com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode + .ZONE_DISTRIBUTION_MODE_UNSPECIFIED + .getNumber()) { + output.writeEnum(1, mode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, zone_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (mode_ + != com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode + .ZONE_DISTRIBUTION_MODE_UNSPECIFIED + .getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, mode_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(zone_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, zone_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.cloud.memorystore.v1beta.ZoneDistributionConfig)) { + return super.equals(obj); + } + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig other = + (com.google.cloud.memorystore.v1beta.ZoneDistributionConfig) obj; + + if (!getZone().equals(other.getZone())) return false; + if (mode_ != other.mode_) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + ZONE_FIELD_NUMBER; + hash = (53 * hash) + getZone().hashCode(); + hash = (37 * hash) + MODE_FIELD_NUMBER; + hash = (53 * hash) + mode_; + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseDelimitedFrom( + java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( + PARSER, input, extensionRegistry); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * + * + *
+   * Zone distribution configuration for allocation of instance resources.
+   * 
+ * + * Protobuf type {@code google.cloud.memorystore.v1beta.ZoneDistributionConfig} + */ + public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:google.cloud.memorystore.v1beta.ZoneDistributionConfig) + com.google.cloud.memorystore.v1beta.ZoneDistributionConfigOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ZoneDistributionConfig_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ZoneDistributionConfig_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.class, + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.Builder.class); + } + + // Construct using com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + zone_ = ""; + mode_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return com.google.cloud.memorystore.v1beta.V1mainProto + .internal_static_google_cloud_memorystore_v1beta_ZoneDistributionConfig_descriptor; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig getDefaultInstanceForType() { + return com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.getDefaultInstance(); + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig build() { + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig buildPartial() { + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig result = + new com.google.cloud.memorystore.v1beta.ZoneDistributionConfig(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0(com.google.cloud.memorystore.v1beta.ZoneDistributionConfig result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.zone_ = zone_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.mode_ = mode_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.cloud.memorystore.v1beta.ZoneDistributionConfig) { + return mergeFrom((com.google.cloud.memorystore.v1beta.ZoneDistributionConfig) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.cloud.memorystore.v1beta.ZoneDistributionConfig other) { + if (other == com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.getDefaultInstance()) + return this; + if (!other.getZone().isEmpty()) { + zone_ = other.zone_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.mode_ != 0) { + setModeValue(other.getModeValue()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == 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: + { + mode_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 8 + case 18: + { + zone_ = 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 zone_ = ""; + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The zone. + */ + public java.lang.String getZone() { + java.lang.Object ref = zone_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + zone_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for zone. + */ + public com.google.protobuf.ByteString getZoneBytes() { + java.lang.Object ref = zone_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + zone_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The zone to set. + * @return This builder for chaining. + */ + public Builder setZone(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + zone_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return This builder for chaining. + */ + public Builder clearZone() { + zone_ = getDefaultInstance().getZone(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Defines zone where all resources will be allocated with
+     * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+     * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @param value The bytes for zone to set. + * @return This builder for chaining. + */ + public Builder setZoneBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + zone_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int mode_ = 0; + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + @java.lang.Override + public int getModeValue() { + return mode_; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The enum numeric value on the wire for mode to set. + * @return This builder for chaining. + */ + public Builder setModeValue(int value) { + mode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode + getMode() { + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode result = + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode.forNumber( + mode_); + return result == null + ? com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode + .UNRECOGNIZED + : result; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @param value The mode to set. + * @return This builder for chaining. + */ + public Builder setMode( + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + mode_ = value.getNumber(); + onChanged(); + return this; + } + /** + * + * + *
+     * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+     * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return This builder for chaining. + */ + public Builder clearMode() { + bitField0_ = (bitField0_ & ~0x00000002); + mode_ = 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.memorystore.v1beta.ZoneDistributionConfig) + } + + // @@protoc_insertion_point(class_scope:google.cloud.memorystore.v1beta.ZoneDistributionConfig) + private static final com.google.cloud.memorystore.v1beta.ZoneDistributionConfig DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new com.google.cloud.memorystore.v1beta.ZoneDistributionConfig(); + } + + public static com.google.cloud.memorystore.v1beta.ZoneDistributionConfig getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ZoneDistributionConfig parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.google.cloud.memorystore.v1beta.ZoneDistributionConfig getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ZoneDistributionConfigOrBuilder.java b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ZoneDistributionConfigOrBuilder.java new file mode 100644 index 000000000000..d125ce621c08 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/java/com/google/cloud/memorystore/v1beta/ZoneDistributionConfigOrBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/cloud/memorystore/v1beta/memorystore.proto + +// Protobuf Java Version: 3.25.5 +package com.google.cloud.memorystore.v1beta; + +public interface ZoneDistributionConfigOrBuilder + extends + // @@protoc_insertion_point(interface_extends:google.cloud.memorystore.v1beta.ZoneDistributionConfig) + com.google.protobuf.MessageOrBuilder { + + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The zone. + */ + java.lang.String getZone(); + /** + * + * + *
+   * Optional. Defines zone where all resources will be allocated with
+   * SINGLE_ZONE mode. Ignored for MULTI_ZONE mode.
+   * 
+ * + * string zone = 2 [(.google.api.field_behavior) = OPTIONAL]; + * + * @return The bytes for zone. + */ + com.google.protobuf.ByteString getZoneBytes(); + + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The enum numeric value on the wire for mode. + */ + int getModeValue(); + /** + * + * + *
+   * Optional. Current zone distribution mode. Defaults to MULTI_ZONE.
+   * 
+ * + * + * .google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode mode = 1 [(.google.api.field_behavior) = OPTIONAL]; + * + * + * @return The mode. + */ + com.google.cloud.memorystore.v1beta.ZoneDistributionConfig.ZoneDistributionMode getMode(); +} diff --git a/java-valkey/proto-google-cloud-valkey-v1beta/src/main/proto/google/cloud/memorystore/v1beta/memorystore.proto b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/proto/google/cloud/memorystore/v1beta/memorystore.proto new file mode 100644 index 000000000000..2839eeb44b03 --- /dev/null +++ b/java-valkey/proto-google-cloud-valkey-v1beta/src/main/proto/google/cloud/memorystore/v1beta/memorystore.proto @@ -0,0 +1,857 @@ +// Copyright 2024 Google LLC +// +// Licensed under the Apache License, Version 2.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.memorystore.v1beta; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.Memorystore.V1Beta"; +option go_package = "cloud.google.com/go/memorystore/apiv1beta/memorystorepb;memorystorepb"; +option java_multiple_files = true; +option java_outer_classname = "V1mainProto"; +option java_package = "com.google.cloud.memorystore.v1beta"; +option php_namespace = "Google\\Cloud\\Memorystore\\V1beta"; +option ruby_package = "Google::Cloud::Memorystore::V1beta"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ForwardingRule" + pattern: "projects/{project}/regions/{region}/forwardingRules/{forwarding_rule}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/ServiceAttachment" + pattern: "projects/{project}/regions/{region}/serviceAttachments/{service_attachment}" +}; + +// Service describing handlers for resources +service Memorystore { + option (google.api.default_host) = "memorystore.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists Instances in a given project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single Instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new Instance in a given project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Updates the parameters of a single Instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets details about the certificate authority for an Instance. + rpc GetCertificateAuthority(GetCertificateAuthorityRequest) + returns (CertificateAuthority) { + option (google.api.http) = { + get: "/v1beta/{name=projects/*/locations/*/instances/*}/certificateAuthority" + }; + option (google.api.method_signature) = "name"; + } +} + +// Status of the PSC connection. +enum PscConnectionStatus { + // PSC connection status is not specified. + PSC_CONNECTION_STATUS_UNSPECIFIED = 0; + + // The connection is active + ACTIVE = 1; + + // Connection not found + NOT_FOUND = 2; +} + +// Type of a PSC connection +enum ConnectionType { + // Connection Type is not set + CONNECTION_TYPE_UNSPECIFIED = 0; + + // Connection that will be used for topology discovery. + CONNECTION_TYPE_DISCOVERY = 1; + + // Connection that will be used as primary endpoint to access primary. + CONNECTION_TYPE_PRIMARY = 2; + + // Connection that will be used as reader endpoint to access replicas. + CONNECTION_TYPE_READER = 3; +} + +// A Memorystore instance. +message Instance { + option (google.api.resource) = { + type: "memorystore.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + plural: "instances" + singular: "instance" + }; + + // Additional information about the state of the instance. + message StateInfo { + // Represents information about instance with state UPDATING. + message UpdateInfo { + // Output only. Target number of shards for the instance. + optional int32 target_shard_count = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Target number of replica nodes per shard for the instance. + optional int32 target_replica_count = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + oneof info { + // Output only. Describes ongoing update when instance state is UPDATING. + UpdateInfo update_info = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + } + + // InstanceEndpoint consists of PSC connections that are created + // as a group in each VPC network for accessing the instance. In each group, + // there shall be one connection for each service attachment in the cluster. + message InstanceEndpoint { + // Optional. A group of PSC connections. They are created in the same VPC + // network, one for each service attachment in the cluster. + repeated ConnectionDetail connections = 1 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Information of each PSC connection. + message ConnectionDetail { + // A PSC connection to an instance could either be created through Service + // Connectivity Automation (auto connection) during the cluster creation, + // or it could be created by customer themeslves (user-created connection). + oneof connection { + // Detailed information of a PSC connection that is created through + // service connectivity automation. + PscAutoConnection psc_auto_connection = 1; + + // Detailed information of a PSC connection that is created by the user. + PscConnection psc_connection = 2; + } + } + + // Possible states of the instance. + enum State { + // Not set. + STATE_UNSPECIFIED = 0; + + // Instance is being created. + CREATING = 1; + + // Instance has been created and is usable. + ACTIVE = 2; + + // Instance is being updated. + UPDATING = 3; + + // Instance is being deleted. + DELETING = 4; + } + + // Possible authorization modes of the instance. + enum AuthorizationMode { + // Not set. + AUTHORIZATION_MODE_UNSPECIFIED = 0; + + // Authorization disabled. + AUTH_DISABLED = 1; + + // IAM basic authorization. + IAM_AUTH = 2; + } + + // Possible in-transit encryption modes of the instance. + enum TransitEncryptionMode { + // Not set. + TRANSIT_ENCRYPTION_MODE_UNSPECIFIED = 0; + + // In-transit encryption is disabled. + TRANSIT_ENCRYPTION_DISABLED = 1; + + // Server-managed encryption is used for in-transit encryption. + SERVER_AUTHENTICATION = 2; + } + + // Possible node types of the instance. See + // https://cloud.google.com/memorystore/docs/valkey/instance-node-specification + // for more information. + enum NodeType { + // Not set. + NODE_TYPE_UNSPECIFIED = 0; + + // Shared core nano. + SHARED_CORE_NANO = 1; + + // High memory medium. + HIGHMEM_MEDIUM = 2; + + // High memory extra large. + HIGHMEM_XLARGE = 3; + + // Standard small. + STANDARD_SMALL = 4; + } + + // The mode config, which is used to enable/disable cluster mode. + enum Mode { + // Mode is not specified. + MODE_UNSPECIFIED = 0; + + // Instance is in standalone mode. + STANDALONE = 1; + + // Instance is in cluster mode. + CLUSTER = 2; + } + + // Identifier. Unique name of the instance. + // Format: projects/{project}/locations/{location}/instances/{instance} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. Creation timestamp of the instance. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Latest update timestamp of the instance. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Labels to represent user-provided metadata. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Current state of the instance. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the state of the instance. + StateInfo state_info = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. System assigned, unique identifier for the instance. + string uid = 7 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Number of replica nodes per shard. If omitted the default is 0 + // replicas. + optional int32 replica_count = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Authorization mode of the instance. + AuthorizationMode authorization_mode = 9 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Immutable. In-transit encryption mode of the instance. + TransitEncryptionMode transit_encryption_mode = 10 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Number of shards for the instance. + int32 shard_count = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Endpoints clients can connect to the instance through. + // Currently only one discovery endpoint is supported. + repeated DiscoveryEndpoint discovery_endpoints = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. Machine type for individual nodes of the instance. + NodeType node_type = 13 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Persistence configuration of the instance. + PersistenceConfig persistence_config = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Immutable. Engine version of the instance. + string engine_version = 15 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. User-provided engine configurations for the instance. + map engine_configs = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Configuration of individual nodes of the instance. + NodeConfig node_config = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Immutable. Zone distribution configuration of the instance for + // node allocation. + ZoneDistributionConfig zone_distribution_config = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. If set to true deletion of the instance will fail. + optional bool deletion_protection_enabled = 19 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. Immutable. User inputs and resource details of the auto-created + // PSC connections. + repeated PscAutoConnection psc_auto_connections = 20 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Optional. Endpoints for the instance. + repeated InstanceEndpoint endpoints = 25 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The mode config for the instance. + Mode mode = 26 [(google.api.field_behavior) = OPTIONAL]; +} + +// Details of consumer resources in a PSC connection. +message PscAutoConnection { + // Ports of the exposed endpoint. + oneof ports { + // Optional. Output only. port will only be set for Primary/Reader or + // Discovery endpoint. + int32 port = 9 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + } + + // 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 ip_address = 2 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The URI of the consumer side forwarding rule. + // Format: + // projects/{project}/regions/{region}/forwardingRules/{forwarding_rule} + string forwarding_rule = 3 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Required. The consumer project_id where PSC connections are established. + // This should be the same project_id that the instance is being created in. + string project_id = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network where the PSC endpoints are created, in the form of + // projects/{project_id}/global/networks/{network_id}. + string network = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Output only. The service attachment which is the target of the PSC + // connection, in the form of + // projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}. + string service_attachment = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceAttachment" + } + ]; + + // Output only. The status of the PSC connection: whether a connection exists + // and ACTIVE or it no longer exists. Please note that this value is updated + // periodically. Please use Private Service Connect APIs for the latest + // status. + PscConnectionStatus psc_connection_status = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of the PSC connection. + ConnectionType connection_type = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// User created Psc connection configuration. +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]; + + // Required. The IP allocated on the consumer network for the PSC forwarding + // rule. + string ip_address = 2 [ + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. The URI of the consumer side forwarding rule. + // Format: + // projects/{project}/regions/{region}/forwardingRules/{forwarding_rule} + string forwarding_rule = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ForwardingRule" + } + ]; + + // Output only. The consumer project_id where the forwarding rule is created + // from. + string project_id = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The consumer network where the IP address resides, in the form of + // projects/{project_id}/global/networks/{network_id}. + string network = 5 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; + + // Required. The service attachment which is the target of the PSC connection, + // in the form of + // projects/{project-id}/regions/{region}/serviceAttachments/{service-attachment-id}. + string service_attachment = 6 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "compute.googleapis.com/ServiceAttachment" + } + ]; + + // Output only. The status of the PSC connection: whether a connection exists + // and ACTIVE or it no longer exists. Please note that this value is updated + // periodically. Please use Private Service Connect APIs for the latest + // status. + PscConnectionStatus psc_connection_status = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Type of the PSC connection. + ConnectionType connection_type = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents an endpoint for clients to connect to the instance. +message DiscoveryEndpoint { + // Output only. IP address of the exposed endpoint clients connect to. + string address = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The port number of the exposed endpoint. + int32 port = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. 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 = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { type: "compute.googleapis.com/Network" } + ]; +} + +// Represents persistence configuration for a instance. +message PersistenceConfig { + // Configuration for RDB based persistence. + message RDBConfig { + // Possible snapshot periods. + enum SnapshotPeriod { + // Not set. + SNAPSHOT_PERIOD_UNSPECIFIED = 0; + + // One hour. + ONE_HOUR = 1; + + // Six hours. + SIX_HOURS = 2; + + // Twelve hours. + TWELVE_HOURS = 3; + + // Twenty four hours. + TWENTY_FOUR_HOURS = 4; + } + + // Optional. Period between RDB snapshots. + SnapshotPeriod rdb_snapshot_period = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time that the first snapshot was/will be attempted, and to + // which future snapshots will be aligned. If not provided, the current time + // will be used. + google.protobuf.Timestamp rdb_snapshot_start_time = 2 + [(google.api.field_behavior) = OPTIONAL]; + } + + // Configuration for AOF based persistence. + message AOFConfig { + // Possible fsync modes. + enum AppendFsync { + // Not set. Default: EVERY_SEC + APPEND_FSYNC_UNSPECIFIED = 0; + + // Never fsync. Normally Linux will flush data every 30 seconds with this + // configuration, but it's up to the kernel's exact tuning. + NEVER = 1; + + // Fsync every second. You may lose 1 second of data if there is a + // disaster. + EVERY_SEC = 2; + + // Fsync every time new write commands are appended to the AOF. The best + // data loss protection at the cost of performance. + ALWAYS = 3; + } + + // Optional. The fsync mode. + AppendFsync append_fsync = 1 [(google.api.field_behavior) = OPTIONAL]; + } + + // Possible persistence modes. + enum PersistenceMode { + // Not set. + PERSISTENCE_MODE_UNSPECIFIED = 0; + + // Persistence is disabled, and any snapshot data is deleted. + DISABLED = 1; + + // RDB based persistence is enabled. + RDB = 2; + + // AOF based persistence is enabled. + AOF = 3; + } + + // Optional. Current persistence mode. + PersistenceMode mode = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. RDB configuration. This field will be ignored if mode is not RDB. + RDBConfig rdb_config = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. AOF configuration. This field will be ignored if mode is not AOF. + AOFConfig aof_config = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents configuration for nodes of the instance. +message NodeConfig { + // Output only. Memory size in GB of the node. + double size_gb = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Zone distribution configuration for allocation of instance resources. +message ZoneDistributionConfig { + // Possible zone distribution modes. + enum ZoneDistributionMode { + // Not Set. Default: MULTI_ZONE + ZONE_DISTRIBUTION_MODE_UNSPECIFIED = 0; + + // Distribute resources across 3 zones picked at random within the + // region. + MULTI_ZONE = 1; + + // Provision resources in a single zone. Zone field must be specified. + SINGLE_ZONE = 2; + } + + // Optional. Defines zone where all resources will be allocated with + // SINGLE_ZONE mode. Ignored for MULTI_ZONE mode. + string zone = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Current zone distribution mode. Defaults to MULTI_ZONE. + ZoneDistributionMode mode = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [ListInstances][]. +message ListInstancesRequest { + // Required. The parent to list instances from. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "memorystore.googleapis.com/Instance" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Expression for filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sort results by a defined order. Supported values: "name", + // "create_time". + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [ListInstances][]. +message ListInstancesResponse { + // If the {location} requested was "-" the response contains a list of + // instances from all locations. Instances in unreachable locations will be + // omitted. + repeated Instance instances = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for [GetInstance][]. +message GetInstanceRequest { + // Required. The name of the instance to retrieve. + // Format: projects/{project}/locations/{location}/instances/{instance} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memorystore.googleapis.com/Instance" + } + ]; +} + +// Request message for [CreateInstance][]. +message CreateInstanceRequest { + // Required. The parent resource where this instance will be created. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "memorystore.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the instance, which will become the final + // component of the instance's resource name. + // + // This value is subject to the following restrictions: + // + // * Must be 4-63 characters in length + // * Must begin with a letter or digit + // * Must contain only lowercase letters, digits, and hyphens + // * Must not end with a hyphen + // * Must be unique within a location + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The instance to create. + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for [UpdateInstance][]. +message UpdateInstanceRequest { + // Optional. The list of fields to be updated on the instance. At least one + // field must be specified. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. The instance to update. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for [DeleteInstance][]. +message DeleteInstanceRequest { + // Required. The name of the instance to delete. + // Format: projects/{project}/locations/{location}/instances/{instance} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memorystore.googleapis.com/Instance" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and the + // request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for [GetCertificateAuthority][]. +message GetCertificateAuthorityRequest { + // Required. The name of the certificate authority. + // Format: + // projects/{project}/locations/{location}/instances/{instance}/certificateAuthority + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "memorystore.googleapis.com/Instance" + } + ]; +} + +// A certificate authority for an instance. +message CertificateAuthority { + option (google.api.resource) = { + type: "memorystore.googleapis.com/CertificateAuthority" + pattern: "projects/{project}/locations/{location}/instances/{instance}/certificateAuthority" + plural: "certificateAuthorities" + singular: "certificateAuthority" + }; + + // A managed certificate authority. + message ManagedCertificateAuthority { + // A certificate chain. + message CertChain { + // The certificates that form the CA chain in order of leaf to root. + repeated string certificates = 1; + } + + // PEM encoded CA certificate chains for managed server authentication. + repeated CertChain ca_certs = 1; + } + + // Information about the server certificate authority. + oneof server_ca { + // A managed server certificate authority. + ManagedCertificateAuthority managed_server_ca = 2; + } + + // Identifier. Unique name of the certificate authority. + // Format: + // projects/{project}/locations/{location}/instances/{instance} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; +} + +// Represents the metadata of a long-running operation. +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 been cancelled successfully + // 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-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/create/SyncCreateSetCredentialsProvider.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..54e2b8806d9e --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.cloud.memorystore.v1.MemorystoreSettings; +import com.google.cloud.memorystore.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 + MemorystoreSettings memorystoreSettings = + MemorystoreSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings); + } +} +// [END memorystore_v1_generated_Memorystore_Create_SetCredentialsProvider_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/create/SyncCreateSetEndpoint.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..b266418ed124 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_Create_SetEndpoint_sync] +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.cloud.memorystore.v1.MemorystoreSettings; +import com.google.cloud.memorystore.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 + MemorystoreSettings memorystoreSettings = + MemorystoreSettings.newBuilder().setEndpoint(myEndpoint).build(); + MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings); + } +} +// [END memorystore_v1_generated_Memorystore_Create_SetEndpoint_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/AsyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/AsyncCreateInstance.java new file mode 100644 index 000000000000..d9ca78b065f8 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/AsyncCreateInstance.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_CreateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1.CreateInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.longrunning.Operation; + +public class AsyncCreateInstance { + + public static void main(String[] args) throws Exception { + asyncCreateInstance(); + } + + public static void asyncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = memorystoreClient.createInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_CreateInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/AsyncCreateInstanceLRO.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/AsyncCreateInstanceLRO.java new file mode 100644 index 000000000000..06c4fab9d482 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/AsyncCreateInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_CreateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.memorystore.v1.CreateInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.cloud.memorystore.v1.OperationMetadata; + +public class AsyncCreateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateInstanceLRO(); + } + + public static void asyncCreateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + memorystoreClient.createInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_CreateInstance_LRO_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..943ff8b77256 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstance.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_CreateInstance_sync] +import com.google.cloud.memorystore.v1.CreateInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Instance response = memorystoreClient.createInstanceAsync(request).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_CreateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstanceLocationnameInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstanceLocationnameInstanceString.java new file mode 100644 index 000000000000..5b7014c46778 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstanceLocationnameInstanceString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_CreateInstance_LocationnameInstanceString_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncCreateInstanceLocationnameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceLocationnameInstanceString(); + } + + public static void syncCreateInstanceLocationnameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_CreateInstance_LocationnameInstanceString_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstanceStringInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstanceStringInstanceString.java new file mode 100644 index 000000000000..639fbe60fbb5 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/createinstance/SyncCreateInstanceStringInstanceString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_CreateInstance_StringInstanceString_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncCreateInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceStringInstanceString(); + } + + public static void syncCreateInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_CreateInstance_StringInstanceString_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/AsyncDeleteInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/AsyncDeleteInstance.java new file mode 100644 index 000000000000..ff34f64fe78c --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/AsyncDeleteInstance.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_DeleteInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteInstance { + + public static void main(String[] args) throws Exception { + asyncDeleteInstance(); + } + + public static void asyncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = memorystoreClient.deleteInstanceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_DeleteInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/AsyncDeleteInstanceLRO.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/AsyncDeleteInstanceLRO.java new file mode 100644 index 000000000000..0b84ed7abaac --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/AsyncDeleteInstanceLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_DeleteInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.memorystore.v1.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.cloud.memorystore.v1.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteInstanceLRO(); + } + + public static void asyncDeleteInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + memorystoreClient.deleteInstanceOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_DeleteInstance_LRO_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstance.java new file mode 100644 index 000000000000..df369a582bc9 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstance.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_DeleteInstance_sync] +import com.google.cloud.memorystore.v1.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.protobuf.Empty; + +public class SyncDeleteInstance { + + public static void main(String[] args) throws Exception { + syncDeleteInstance(); + } + + public static void syncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + memorystoreClient.deleteInstanceAsync(request).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_DeleteInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstanceInstancename.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstanceInstancename.java new file mode 100644 index 000000000000..0c2874e0f242 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_DeleteInstance_Instancename_sync] +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceInstancename(); + } + + public static void syncDeleteInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + memorystoreClient.deleteInstanceAsync(name).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_DeleteInstance_Instancename_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstanceString.java new file mode 100644 index 000000000000..30f7a7d4e721 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/deleteinstance/SyncDeleteInstanceString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_DeleteInstance_String_sync] +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceString { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceString(); + } + + public static void syncDeleteInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + memorystoreClient.deleteInstanceAsync(name).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_DeleteInstance_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/AsyncGetCertificateAuthority.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/AsyncGetCertificateAuthority.java new file mode 100644 index 000000000000..4f6d5cc8abdf --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/AsyncGetCertificateAuthority.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetCertificateAuthority_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1.CertificateAuthority; +import com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class AsyncGetCertificateAuthority { + + public static void main(String[] args) throws Exception { + asyncGetCertificateAuthority(); + } + + public static void asyncGetCertificateAuthority() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = + memorystoreClient.getCertificateAuthorityCallable().futureCall(request); + // Do something. + CertificateAuthority response = future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetCertificateAuthority_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthority.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthority.java new file mode 100644 index 000000000000..c94fcb1d465f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthority.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetCertificateAuthority_sync] +import com.google.cloud.memorystore.v1.CertificateAuthority; +import com.google.cloud.memorystore.v1.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncGetCertificateAuthority { + + public static void main(String[] args) throws Exception { + syncGetCertificateAuthority(); + } + + public static void syncGetCertificateAuthority() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + CertificateAuthority response = memorystoreClient.getCertificateAuthority(request); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetCertificateAuthority_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthorityInstancename.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthorityInstancename.java new file mode 100644 index 000000000000..850d072b2c02 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthorityInstancename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetCertificateAuthority_Instancename_sync] +import com.google.cloud.memorystore.v1.CertificateAuthority; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncGetCertificateAuthorityInstancename { + + public static void main(String[] args) throws Exception { + syncGetCertificateAuthorityInstancename(); + } + + public static void syncGetCertificateAuthorityInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + CertificateAuthority response = memorystoreClient.getCertificateAuthority(name); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetCertificateAuthority_Instancename_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthorityString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthorityString.java new file mode 100644 index 000000000000..444ab5015b85 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getcertificateauthority/SyncGetCertificateAuthorityString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetCertificateAuthority_String_sync] +import com.google.cloud.memorystore.v1.CertificateAuthority; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncGetCertificateAuthorityString { + + public static void main(String[] args) throws Exception { + syncGetCertificateAuthorityString(); + } + + public static void syncGetCertificateAuthorityString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + CertificateAuthority response = memorystoreClient.getCertificateAuthority(name); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetCertificateAuthority_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/AsyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/AsyncGetInstance.java new file mode 100644 index 000000000000..ef9cf74aecc8 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/AsyncGetInstance.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1.GetInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class AsyncGetInstance { + + public static void main(String[] args) throws Exception { + asyncGetInstance(); + } + + public static void asyncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = memorystoreClient.getInstanceCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..5ede74a19fad --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstance.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetInstance_sync] +import com.google.cloud.memorystore.v1.GetInstanceRequest; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + Instance response = memorystoreClient.getInstance(request); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstanceInstancename.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstanceInstancename.java new file mode 100644 index 000000000000..a49e7082342f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetInstance_Instancename_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncGetInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncGetInstanceInstancename(); + } + + public static void syncGetInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Instance response = memorystoreClient.getInstance(name); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetInstance_Instancename_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstanceString.java new file mode 100644 index 000000000000..e7bbb6f2e258 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getinstance/SyncGetInstanceString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetInstance_String_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.InstanceName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncGetInstanceString { + + public static void main(String[] args) throws Exception { + syncGetInstanceString(); + } + + public static void syncGetInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + Instance response = memorystoreClient.getInstance(name); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetInstance_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getlocation/AsyncGetLocation.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..6117e0af6e5f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = memorystoreClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetLocation_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getlocation/SyncGetLocation.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..648c8a303f4b --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = memorystoreClient.getLocation(request); + } + } +} +// [END memorystore_v1_generated_Memorystore_GetLocation_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/AsyncListInstances.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/AsyncListInstances.java new file mode 100644 index 000000000000..01c309de55c6 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/AsyncListInstances.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_ListInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.ListInstancesRequest; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class AsyncListInstances { + + public static void main(String[] args) throws Exception { + asyncListInstances(); + } + + public static void asyncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + memorystoreClient.listInstancesPagedCallable().futureCall(request); + // Do something. + for (Instance element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1_generated_Memorystore_ListInstances_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/AsyncListInstancesPaged.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/AsyncListInstancesPaged.java new file mode 100644 index 000000000000..787f6d6bdc76 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/AsyncListInstancesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_ListInstances_Paged_async] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.ListInstancesRequest; +import com.google.cloud.memorystore.v1.ListInstancesResponse; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.common.base.Strings; + +public class AsyncListInstancesPaged { + + public static void main(String[] args) throws Exception { + asyncListInstancesPaged(); + } + + public static void asyncListInstancesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListInstancesResponse response = memorystoreClient.listInstancesCallable().call(request); + for (Instance element : response.getInstancesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END memorystore_v1_generated_Memorystore_ListInstances_Paged_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstances.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstances.java new file mode 100644 index 000000000000..381e742b0b4d --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstances.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_ListInstances_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.ListInstancesRequest; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncListInstances { + + public static void main(String[] args) throws Exception { + syncListInstances(); + } + + public static void syncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Instance element : memorystoreClient.listInstances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1_generated_Memorystore_ListInstances_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstancesLocationname.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstancesLocationname.java new file mode 100644 index 000000000000..d221325d44c1 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstancesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_ListInstances_Locationname_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncListInstancesLocationname { + + public static void main(String[] args) throws Exception { + syncListInstancesLocationname(); + } + + public static void syncListInstancesLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1_generated_Memorystore_ListInstances_Locationname_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstancesString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstancesString.java new file mode 100644 index 000000000000..e0c5bf00e11b --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listinstances/SyncListInstancesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_ListInstances_String_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.LocationName; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +public class SyncListInstancesString { + + public static void main(String[] args) throws Exception { + syncListInstancesString(); + } + + public static void syncListInstancesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1_generated_Memorystore_ListInstances_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/AsyncListLocations.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..d390ebb1e086 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + memorystoreClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1_generated_Memorystore_ListLocations_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/AsyncListLocationsPaged.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..ca18ea412ae2 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_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.memorystore.v1.MemorystoreClient; +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = memorystoreClient.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 memorystore_v1_generated_Memorystore_ListLocations_Paged_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/SyncListLocations.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..ff6e797e98cc --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : memorystoreClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1_generated_Memorystore_ListLocations_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/AsyncUpdateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/AsyncUpdateInstance.java new file mode 100644 index 000000000000..86a750614f3d --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/AsyncUpdateInstance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_UpdateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.cloud.memorystore.v1.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstance { + + public static void main(String[] args) throws Exception { + asyncUpdateInstance(); + } + + public static void asyncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = memorystoreClient.updateInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_UpdateInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/AsyncUpdateInstanceLRO.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/AsyncUpdateInstanceLRO.java new file mode 100644 index 000000000000..a062b625893b --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/AsyncUpdateInstanceLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_UpdateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.cloud.memorystore.v1.OperationMetadata; +import com.google.cloud.memorystore.v1.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateInstanceLRO(); + } + + public static void asyncUpdateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + memorystoreClient.updateInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_UpdateInstance_LRO_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/SyncUpdateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/SyncUpdateInstance.java new file mode 100644 index 000000000000..273e72e333e6 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/SyncUpdateInstance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_UpdateInstance_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.cloud.memorystore.v1.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstance { + + public static void main(String[] args) throws Exception { + syncUpdateInstance(); + } + + public static void syncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Instance response = memorystoreClient.updateInstanceAsync(request).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_UpdateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/SyncUpdateInstanceInstanceFieldmask.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/SyncUpdateInstanceInstanceFieldmask.java new file mode 100644 index 000000000000..60f803f5c21d --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystore/updateinstance/SyncUpdateInstanceInstanceFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_Memorystore_UpdateInstance_InstanceFieldmask_sync] +import com.google.cloud.memorystore.v1.Instance; +import com.google.cloud.memorystore.v1.MemorystoreClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstanceInstanceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateInstanceInstanceFieldmask(); + } + + public static void syncUpdateInstanceInstanceFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance response = memorystoreClient.updateInstanceAsync(instance, updateMask).get(); + } + } +} +// [END memorystore_v1_generated_Memorystore_UpdateInstance_InstanceFieldmask_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystoresettings/createinstance/SyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystoresettings/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..c6f716d02f0b --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystoresettings/createinstance/SyncCreateInstance.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_MemorystoreSettings_CreateInstance_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.memorystore.v1.MemorystoreSettings; +import java.time.Duration; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + memorystoreSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END memorystore_v1_generated_MemorystoreSettings_CreateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystoresettings/getinstance/SyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystoresettings/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..242525f27213 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/memorystoresettings/getinstance/SyncGetInstance.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.samples; + +// [START memorystore_v1_generated_MemorystoreSettings_GetInstance_sync] +import com.google.cloud.memorystore.v1.MemorystoreSettings; +import java.time.Duration; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder(); + memorystoreSettingsBuilder + .getInstanceSettings() + .setRetrySettings( + memorystoreSettingsBuilder + .getInstanceSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MemorystoreSettings memorystoreSettings = memorystoreSettingsBuilder.build(); + } +} +// [END memorystore_v1_generated_MemorystoreSettings_GetInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/stub/memorystorestubsettings/createinstance/SyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/stub/memorystorestubsettings/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..ad2a8135c9ea --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/stub/memorystorestubsettings/createinstance/SyncCreateInstance.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.stub.samples; + +// [START memorystore_v1_generated_MemorystoreStubSettings_CreateInstance_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.memorystore.v1.stub.MemorystoreStubSettings; +import java.time.Duration; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreStubSettings.Builder memorystoreSettingsBuilder = + MemorystoreStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + memorystoreSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END memorystore_v1_generated_MemorystoreStubSettings_CreateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/stub/memorystorestubsettings/getinstance/SyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/stub/memorystorestubsettings/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..893301d19bb4 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1/stub/memorystorestubsettings/getinstance/SyncGetInstance.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1.stub.samples; + +// [START memorystore_v1_generated_MemorystoreStubSettings_GetInstance_sync] +import com.google.cloud.memorystore.v1.stub.MemorystoreStubSettings; +import java.time.Duration; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreStubSettings.Builder memorystoreSettingsBuilder = + MemorystoreStubSettings.newBuilder(); + memorystoreSettingsBuilder + .getInstanceSettings() + .setRetrySettings( + memorystoreSettingsBuilder + .getInstanceSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MemorystoreStubSettings memorystoreSettings = memorystoreSettingsBuilder.build(); + } +} +// [END memorystore_v1_generated_MemorystoreStubSettings_GetInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/create/SyncCreateSetCredentialsProvider.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/create/SyncCreateSetCredentialsProvider.java new file mode 100644 index 000000000000..ba3a417aa373 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/create/SyncCreateSetCredentialsProvider.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_Create_SetCredentialsProvider_sync] +import com.google.api.gax.core.FixedCredentialsProvider; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.cloud.memorystore.v1beta.MemorystoreSettings; +import com.google.cloud.memorystore.v1beta.myCredentials; + +public class SyncCreateSetCredentialsProvider { + + public static void main(String[] args) throws Exception { + syncCreateSetCredentialsProvider(); + } + + public static void syncCreateSetCredentialsProvider() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreSettings memorystoreSettings = + MemorystoreSettings.newBuilder() + .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials)) + .build(); + MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings); + } +} +// [END memorystore_v1beta_generated_Memorystore_Create_SetCredentialsProvider_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/create/SyncCreateSetEndpoint.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/create/SyncCreateSetEndpoint.java new file mode 100644 index 000000000000..93b4e55506a0 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/create/SyncCreateSetEndpoint.java @@ -0,0 +1,41 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_Create_SetEndpoint_sync] +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.cloud.memorystore.v1beta.MemorystoreSettings; +import com.google.cloud.memorystore.v1beta.myEndpoint; + +public class SyncCreateSetEndpoint { + + public static void main(String[] args) throws Exception { + syncCreateSetEndpoint(); + } + + public static void syncCreateSetEndpoint() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreSettings memorystoreSettings = + MemorystoreSettings.newBuilder().setEndpoint(myEndpoint).build(); + MemorystoreClient memorystoreClient = MemorystoreClient.create(memorystoreSettings); + } +} +// [END memorystore_v1beta_generated_Memorystore_Create_SetEndpoint_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/AsyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/AsyncCreateInstance.java new file mode 100644 index 000000000000..70b765f03d5d --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/AsyncCreateInstance.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_CreateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1beta.CreateInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.longrunning.Operation; + +public class AsyncCreateInstance { + + public static void main(String[] args) throws Exception { + asyncCreateInstance(); + } + + public static void asyncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = memorystoreClient.createInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_CreateInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/AsyncCreateInstanceLRO.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/AsyncCreateInstanceLRO.java new file mode 100644 index 000000000000..a6b66ca0637c --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/AsyncCreateInstanceLRO.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_CreateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.memorystore.v1beta.CreateInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.cloud.memorystore.v1beta.OperationMetadata; + +public class AsyncCreateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncCreateInstanceLRO(); + } + + public static void asyncCreateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + memorystoreClient.createInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_CreateInstance_LRO_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..cc5b00e9cec2 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstance.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_CreateInstance_sync] +import com.google.cloud.memorystore.v1beta.CreateInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + CreateInstanceRequest request = + CreateInstanceRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setInstanceId("instanceId902024336") + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Instance response = memorystoreClient.createInstanceAsync(request).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_CreateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstanceLocationnameInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstanceLocationnameInstanceString.java new file mode 100644 index 000000000000..4257cb3a6daa --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstanceLocationnameInstanceString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_CreateInstance_LocationnameInstanceString_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncCreateInstanceLocationnameInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceLocationnameInstanceString(); + } + + public static void syncCreateInstanceLocationnameInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_CreateInstance_LocationnameInstanceString_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstanceStringInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstanceStringInstanceString.java new file mode 100644 index 000000000000..9b713dea0606 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/createinstance/SyncCreateInstanceStringInstanceString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_CreateInstance_StringInstanceString_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncCreateInstanceStringInstanceString { + + public static void main(String[] args) throws Exception { + syncCreateInstanceStringInstanceString(); + } + + public static void syncCreateInstanceStringInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + Instance instance = Instance.newBuilder().build(); + String instanceId = "instanceId902024336"; + Instance response = memorystoreClient.createInstanceAsync(parent, instance, instanceId).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_CreateInstance_StringInstanceString_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/AsyncDeleteInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/AsyncDeleteInstance.java new file mode 100644 index 000000000000..4c6ffef25fa0 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/AsyncDeleteInstance.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_DeleteInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1beta.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.longrunning.Operation; + +public class AsyncDeleteInstance { + + public static void main(String[] args) throws Exception { + asyncDeleteInstance(); + } + + public static void asyncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = memorystoreClient.deleteInstanceCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_DeleteInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/AsyncDeleteInstanceLRO.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/AsyncDeleteInstanceLRO.java new file mode 100644 index 000000000000..8b1a08caf2f4 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/AsyncDeleteInstanceLRO.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_DeleteInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.memorystore.v1beta.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.cloud.memorystore.v1beta.OperationMetadata; +import com.google.protobuf.Empty; + +public class AsyncDeleteInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncDeleteInstanceLRO(); + } + + public static void asyncDeleteInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + memorystoreClient.deleteInstanceOperationCallable().futureCall(request); + // Do something. + future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_DeleteInstance_LRO_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstance.java new file mode 100644 index 000000000000..5e9c414064a6 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstance.java @@ -0,0 +1,47 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_DeleteInstance_sync] +import com.google.cloud.memorystore.v1beta.DeleteInstanceRequest; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.protobuf.Empty; + +public class SyncDeleteInstance { + + public static void main(String[] args) throws Exception { + syncDeleteInstance(); + } + + public static void syncDeleteInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + DeleteInstanceRequest request = + DeleteInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .setRequestId("requestId693933066") + .build(); + memorystoreClient.deleteInstanceAsync(request).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_DeleteInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstanceInstancename.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstanceInstancename.java new file mode 100644 index 000000000000..cff65f3de655 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_DeleteInstance_Instancename_sync] +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceInstancename(); + } + + public static void syncDeleteInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + memorystoreClient.deleteInstanceAsync(name).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_DeleteInstance_Instancename_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstanceString.java new file mode 100644 index 000000000000..adf032c05edb --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/deleteinstance/SyncDeleteInstanceString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_DeleteInstance_String_sync] +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.protobuf.Empty; + +public class SyncDeleteInstanceString { + + public static void main(String[] args) throws Exception { + syncDeleteInstanceString(); + } + + public static void syncDeleteInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + memorystoreClient.deleteInstanceAsync(name).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_DeleteInstance_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/AsyncGetCertificateAuthority.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/AsyncGetCertificateAuthority.java new file mode 100644 index 000000000000..5b6a3f12fdac --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/AsyncGetCertificateAuthority.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1beta.CertificateAuthority; +import com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class AsyncGetCertificateAuthority { + + public static void main(String[] args) throws Exception { + asyncGetCertificateAuthority(); + } + + public static void asyncGetCertificateAuthority() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = + memorystoreClient.getCertificateAuthorityCallable().futureCall(request); + // Do something. + CertificateAuthority response = future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthority.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthority.java new file mode 100644 index 000000000000..518f799e2e2b --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthority.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_sync] +import com.google.cloud.memorystore.v1beta.CertificateAuthority; +import com.google.cloud.memorystore.v1beta.GetCertificateAuthorityRequest; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncGetCertificateAuthority { + + public static void main(String[] args) throws Exception { + syncGetCertificateAuthority(); + } + + public static void syncGetCertificateAuthority() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetCertificateAuthorityRequest request = + GetCertificateAuthorityRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + CertificateAuthority response = memorystoreClient.getCertificateAuthority(request); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthorityInstancename.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthorityInstancename.java new file mode 100644 index 000000000000..d6db6b630d8f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthorityInstancename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_Instancename_sync] +import com.google.cloud.memorystore.v1beta.CertificateAuthority; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncGetCertificateAuthorityInstancename { + + public static void main(String[] args) throws Exception { + syncGetCertificateAuthorityInstancename(); + } + + public static void syncGetCertificateAuthorityInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + CertificateAuthority response = memorystoreClient.getCertificateAuthority(name); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_Instancename_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthorityString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthorityString.java new file mode 100644 index 000000000000..ec66b918eea1 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getcertificateauthority/SyncGetCertificateAuthorityString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_String_sync] +import com.google.cloud.memorystore.v1beta.CertificateAuthority; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncGetCertificateAuthorityString { + + public static void main(String[] args) throws Exception { + syncGetCertificateAuthorityString(); + } + + public static void syncGetCertificateAuthorityString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + CertificateAuthority response = memorystoreClient.getCertificateAuthority(name); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetCertificateAuthority_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/AsyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/AsyncGetInstance.java new file mode 100644 index 000000000000..9b74d4afd2ec --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/AsyncGetInstance.java @@ -0,0 +1,49 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1beta.GetInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class AsyncGetInstance { + + public static void main(String[] args) throws Exception { + asyncGetInstance(); + } + + public static void asyncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + ApiFuture future = memorystoreClient.getInstanceCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..4c4bbc3ade6f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstance.java @@ -0,0 +1,46 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetInstance_sync] +import com.google.cloud.memorystore.v1beta.GetInstanceRequest; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetInstanceRequest request = + GetInstanceRequest.newBuilder() + .setName(InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString()) + .build(); + Instance response = memorystoreClient.getInstance(request); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstanceInstancename.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstanceInstancename.java new file mode 100644 index 000000000000..0c5d7284b645 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstanceInstancename.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetInstance_Instancename_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncGetInstanceInstancename { + + public static void main(String[] args) throws Exception { + syncGetInstanceInstancename(); + } + + public static void syncGetInstanceInstancename() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + InstanceName name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]"); + Instance response = memorystoreClient.getInstance(name); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetInstance_Instancename_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstanceString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstanceString.java new file mode 100644 index 000000000000..daa7f13c0979 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getinstance/SyncGetInstanceString.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetInstance_String_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.InstanceName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncGetInstanceString { + + public static void main(String[] args) throws Exception { + syncGetInstanceString(); + } + + public static void syncGetInstanceString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String name = InstanceName.of("[PROJECT]", "[LOCATION]", "[INSTANCE]").toString(); + Instance response = memorystoreClient.getInstance(name); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetInstance_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getlocation/AsyncGetLocation.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getlocation/AsyncGetLocation.java new file mode 100644 index 000000000000..c7a469eaca5d --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getlocation/AsyncGetLocation.java @@ -0,0 +1,45 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetLocation_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + ApiFuture future = memorystoreClient.getLocationCallable().futureCall(request); + // Do something. + Location response = future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetLocation_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getlocation/SyncGetLocation.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getlocation/SyncGetLocation.java new file mode 100644 index 000000000000..e55fc5ad51c9 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/getlocation/SyncGetLocation.java @@ -0,0 +1,42 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_GetLocation_sync] +import com.google.cloud.location.GetLocationRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); + Location response = memorystoreClient.getLocation(request); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_GetLocation_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/AsyncListInstances.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/AsyncListInstances.java new file mode 100644 index 000000000000..584a04e0dcc3 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/AsyncListInstances.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_ListInstances_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.ListInstancesRequest; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class AsyncListInstances { + + public static void main(String[] args) throws Exception { + asyncListInstances(); + } + + public static void asyncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + ApiFuture future = + memorystoreClient.listInstancesPagedCallable().futureCall(request); + // Do something. + for (Instance element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1beta_generated_Memorystore_ListInstances_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/AsyncListInstancesPaged.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/AsyncListInstancesPaged.java new file mode 100644 index 000000000000..fc6579bec69e --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/AsyncListInstancesPaged.java @@ -0,0 +1,63 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_ListInstances_Paged_async] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.ListInstancesRequest; +import com.google.cloud.memorystore.v1beta.ListInstancesResponse; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.common.base.Strings; + +public class AsyncListInstancesPaged { + + public static void main(String[] args) throws Exception { + asyncListInstancesPaged(); + } + + public static void asyncListInstancesPaged() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + while (true) { + ListInstancesResponse response = memorystoreClient.listInstancesCallable().call(request); + for (Instance element : response.getInstancesList()) { + // doThingsWith(element); + } + String nextPageToken = response.getNextPageToken(); + if (!Strings.isNullOrEmpty(nextPageToken)) { + request = request.toBuilder().setPageToken(nextPageToken).build(); + } else { + break; + } + } + } + } +} +// [END memorystore_v1beta_generated_Memorystore_ListInstances_Paged_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstances.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstances.java new file mode 100644 index 000000000000..c924ece3370f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstances.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_ListInstances_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.ListInstancesRequest; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncListInstances { + + public static void main(String[] args) throws Exception { + syncListInstances(); + } + + public static void syncListInstances() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListInstancesRequest request = + ListInstancesRequest.newBuilder() + .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .setFilter("filter-1274492040") + .setOrderBy("orderBy-1207110587") + .build(); + for (Instance element : memorystoreClient.listInstances(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1beta_generated_Memorystore_ListInstances_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstancesLocationname.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstancesLocationname.java new file mode 100644 index 000000000000..d758541ee471 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstancesLocationname.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_ListInstances_Locationname_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncListInstancesLocationname { + + public static void main(String[] args) throws Exception { + syncListInstancesLocationname(); + } + + public static void syncListInstancesLocationname() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); + for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1beta_generated_Memorystore_ListInstances_Locationname_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstancesString.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstancesString.java new file mode 100644 index 000000000000..76259cd1422d --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listinstances/SyncListInstancesString.java @@ -0,0 +1,44 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_ListInstances_String_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.LocationName; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +public class SyncListInstancesString { + + public static void main(String[] args) throws Exception { + syncListInstancesString(); + } + + public static void syncListInstancesString() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); + for (Instance element : memorystoreClient.listInstances(parent).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1beta_generated_Memorystore_ListInstances_String_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/AsyncListLocations.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/AsyncListLocations.java new file mode 100644 index 000000000000..09b82a518540 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/AsyncListLocations.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_ListLocations_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + ApiFuture future = + memorystoreClient.listLocationsPagedCallable().futureCall(request); + // Do something. + for (Location element : future.get().iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1beta_generated_Memorystore_ListLocations_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/AsyncListLocationsPaged.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/AsyncListLocationsPaged.java new file mode 100644 index 000000000000..abec12871498 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/AsyncListLocationsPaged.java @@ -0,0 +1,61 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_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.memorystore.v1beta.MemorystoreClient; +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + while (true) { + ListLocationsResponse response = memorystoreClient.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 memorystore_v1beta_generated_Memorystore_ListLocations_Paged_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/SyncListLocations.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/SyncListLocations.java new file mode 100644 index 000000000000..1e88924e7496 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/listlocations/SyncListLocations.java @@ -0,0 +1,50 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_ListLocations_sync] +import com.google.cloud.location.ListLocationsRequest; +import com.google.cloud.location.Location; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; + +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 (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + ListLocationsRequest request = + ListLocationsRequest.newBuilder() + .setName("name3373707") + .setFilter("filter-1274492040") + .setPageSize(883849137) + .setPageToken("pageToken873572522") + .build(); + for (Location element : memorystoreClient.listLocations(request).iterateAll()) { + // doThingsWith(element); + } + } + } +} +// [END memorystore_v1beta_generated_Memorystore_ListLocations_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/AsyncUpdateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/AsyncUpdateInstance.java new file mode 100644 index 000000000000..69a1b69f6d6a --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/AsyncUpdateInstance.java @@ -0,0 +1,52 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_UpdateInstance_async] +import com.google.api.core.ApiFuture; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.cloud.memorystore.v1beta.UpdateInstanceRequest; +import com.google.longrunning.Operation; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstance { + + public static void main(String[] args) throws Exception { + asyncUpdateInstance(); + } + + public static void asyncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + ApiFuture future = memorystoreClient.updateInstanceCallable().futureCall(request); + // Do something. + Operation response = future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_UpdateInstance_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/AsyncUpdateInstanceLRO.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/AsyncUpdateInstanceLRO.java new file mode 100644 index 000000000000..f479be409983 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/AsyncUpdateInstanceLRO.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_UpdateInstance_LRO_async] +import com.google.api.gax.longrunning.OperationFuture; +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.cloud.memorystore.v1beta.OperationMetadata; +import com.google.cloud.memorystore.v1beta.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class AsyncUpdateInstanceLRO { + + public static void main(String[] args) throws Exception { + asyncUpdateInstanceLRO(); + } + + public static void asyncUpdateInstanceLRO() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + OperationFuture future = + memorystoreClient.updateInstanceOperationCallable().futureCall(request); + // Do something. + Instance response = future.get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_UpdateInstance_LRO_async] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/SyncUpdateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/SyncUpdateInstance.java new file mode 100644 index 000000000000..9e33779a370f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/SyncUpdateInstance.java @@ -0,0 +1,48 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_UpdateInstance_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.cloud.memorystore.v1beta.UpdateInstanceRequest; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstance { + + public static void main(String[] args) throws Exception { + syncUpdateInstance(); + } + + public static void syncUpdateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + UpdateInstanceRequest request = + UpdateInstanceRequest.newBuilder() + .setUpdateMask(FieldMask.newBuilder().build()) + .setInstance(Instance.newBuilder().build()) + .setRequestId("requestId693933066") + .build(); + Instance response = memorystoreClient.updateInstanceAsync(request).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_UpdateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/SyncUpdateInstanceInstanceFieldmask.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/SyncUpdateInstanceInstanceFieldmask.java new file mode 100644 index 000000000000..3eb1fd6d067f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystore/updateinstance/SyncUpdateInstanceInstanceFieldmask.java @@ -0,0 +1,43 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_Memorystore_UpdateInstance_InstanceFieldmask_sync] +import com.google.cloud.memorystore.v1beta.Instance; +import com.google.cloud.memorystore.v1beta.MemorystoreClient; +import com.google.protobuf.FieldMask; + +public class SyncUpdateInstanceInstanceFieldmask { + + public static void main(String[] args) throws Exception { + syncUpdateInstanceInstanceFieldmask(); + } + + public static void syncUpdateInstanceInstanceFieldmask() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + try (MemorystoreClient memorystoreClient = MemorystoreClient.create()) { + Instance instance = Instance.newBuilder().build(); + FieldMask updateMask = FieldMask.newBuilder().build(); + Instance response = memorystoreClient.updateInstanceAsync(instance, updateMask).get(); + } + } +} +// [END memorystore_v1beta_generated_Memorystore_UpdateInstance_InstanceFieldmask_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystoresettings/createinstance/SyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystoresettings/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..300b7c558ab2 --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystoresettings/createinstance/SyncCreateInstance.java @@ -0,0 +1,53 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_MemorystoreSettings_CreateInstance_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.memorystore.v1beta.MemorystoreSettings; +import java.time.Duration; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + memorystoreSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END memorystore_v1beta_generated_MemorystoreSettings_CreateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystoresettings/getinstance/SyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystoresettings/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..9114e675083e --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/memorystoresettings/getinstance/SyncGetInstance.java @@ -0,0 +1,55 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.samples; + +// [START memorystore_v1beta_generated_MemorystoreSettings_GetInstance_sync] +import com.google.cloud.memorystore.v1beta.MemorystoreSettings; +import java.time.Duration; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreSettings.Builder memorystoreSettingsBuilder = MemorystoreSettings.newBuilder(); + memorystoreSettingsBuilder + .getInstanceSettings() + .setRetrySettings( + memorystoreSettingsBuilder + .getInstanceSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MemorystoreSettings memorystoreSettings = memorystoreSettingsBuilder.build(); + } +} +// [END memorystore_v1beta_generated_MemorystoreSettings_GetInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/stub/memorystorestubsettings/createinstance/SyncCreateInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/stub/memorystorestubsettings/createinstance/SyncCreateInstance.java new file mode 100644 index 000000000000..ea05753d5d6f --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/stub/memorystorestubsettings/createinstance/SyncCreateInstance.java @@ -0,0 +1,54 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.stub.samples; + +// [START memorystore_v1beta_generated_MemorystoreStubSettings_CreateInstance_sync] +import com.google.api.gax.longrunning.OperationalTimedPollAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.TimedRetryAlgorithm; +import com.google.cloud.memorystore.v1beta.stub.MemorystoreStubSettings; +import java.time.Duration; + +public class SyncCreateInstance { + + public static void main(String[] args) throws Exception { + syncCreateInstance(); + } + + public static void syncCreateInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreStubSettings.Builder memorystoreSettingsBuilder = + MemorystoreStubSettings.newBuilder(); + TimedRetryAlgorithm timedRetryAlgorithm = + OperationalTimedPollAlgorithm.create( + RetrySettings.newBuilder() + .setInitialRetryDelayDuration(Duration.ofMillis(500)) + .setRetryDelayMultiplier(1.5) + .setMaxRetryDelayDuration(Duration.ofMillis(5000)) + .setTotalTimeoutDuration(Duration.ofHours(24)) + .build()); + memorystoreSettingsBuilder + .createClusterOperationSettings() + .setPollingAlgorithm(timedRetryAlgorithm) + .build(); + } +} +// [END memorystore_v1beta_generated_MemorystoreStubSettings_CreateInstance_sync] diff --git a/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/stub/memorystorestubsettings/getinstance/SyncGetInstance.java b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/stub/memorystorestubsettings/getinstance/SyncGetInstance.java new file mode 100644 index 000000000000..d0fd9fc553be --- /dev/null +++ b/java-valkey/samples/snippets/generated/com/google/cloud/memorystore/v1beta/stub/memorystorestubsettings/getinstance/SyncGetInstance.java @@ -0,0 +1,56 @@ +/* + * Copyright 2024 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.cloud.memorystore.v1beta.stub.samples; + +// [START memorystore_v1beta_generated_MemorystoreStubSettings_GetInstance_sync] +import com.google.cloud.memorystore.v1beta.stub.MemorystoreStubSettings; +import java.time.Duration; + +public class SyncGetInstance { + + public static void main(String[] args) throws Exception { + syncGetInstance(); + } + + public static void syncGetInstance() throws Exception { + // This snippet has been automatically generated and should be regarded as a code template only. + // It will require modifications to work: + // - It may require correct/in-range values for request initialization. + // - It may require specifying regional endpoints when creating the service client as shown in + // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library + MemorystoreStubSettings.Builder memorystoreSettingsBuilder = + MemorystoreStubSettings.newBuilder(); + memorystoreSettingsBuilder + .getInstanceSettings() + .setRetrySettings( + memorystoreSettingsBuilder + .getInstanceSettings() + .getRetrySettings() + .toBuilder() + .setInitialRetryDelayDuration(Duration.ofSeconds(1)) + .setInitialRpcTimeoutDuration(Duration.ofSeconds(5)) + .setMaxAttempts(5) + .setMaxRetryDelayDuration(Duration.ofSeconds(30)) + .setMaxRpcTimeoutDuration(Duration.ofSeconds(60)) + .setRetryDelayMultiplier(1.3) + .setRpcTimeoutMultiplier(1.5) + .setTotalTimeoutDuration(Duration.ofSeconds(300)) + .build()); + MemorystoreStubSettings memorystoreSettings = memorystoreSettingsBuilder.build(); + } +} +// [END memorystore_v1beta_generated_MemorystoreStubSettings_GetInstance_sync] diff --git a/pom.xml b/pom.xml index 345aa5d95a51..b47be9966c9f 100644 --- a/pom.xml +++ b/pom.xml @@ -204,6 +204,7 @@ java-tpu java-trace java-translate + java-valkey java-vertexai java-video-intelligence java-video-live-stream diff --git a/versions.txt b/versions.txt index 34b2b77ede43..c3353f8912e6 100644 --- a/versions.txt +++ b/versions.txt @@ -820,3 +820,6 @@ grpc-google-maps-fleetengine-delivery-v1:0.2.0:0.2.0 google-shopping-merchant-reviews:0.1.0:0.1.0 proto-google-shopping-merchant-reviews-v1beta:0.1.0:0.1.0 grpc-google-shopping-merchant-reviews-v1beta:0.1.0:0.1.0 +google-cloud-valkey:0.1.0:0.1.0 +proto-google-cloud-valkey-v1:0.1.0:0.1.0 +proto-google-cloud-valkey-v1beta:0.1.0:0.1.0 \ No newline at end of file